unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* key binding with windows and menu keys
@ 2005-08-14  1:18 Tyler
  0 siblings, 0 replies; 18+ messages in thread
From: Tyler @ 2005-08-14  1:18 UTC (permalink / raw)


Hi,

I'd like to bind the windows key to scroll-other-window-down, as is set 
to C-M-s-v by default. I've been googling for answers, but can't figure 
out what to call the windows key. My keyboard has a full complement of 
CTRL, Shift, Esc, and Alt keys which behave as expected. It would be 
nice to make use of the 'Windows' and 'Menu' keys as well. Can anyone 
tell me how to do so?

Thanks,

Tyler

ps. the goal would be to add something like the following to my .emacs 
file, only with proper syntax:

(global-set-key "\WINDOWS-z" 'scroll-other-window-down)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
@ 2005-08-14  2:23 Sean Sieger
  0 siblings, 0 replies; 18+ messages in thread
From: Sean Sieger @ 2005-08-14  2:23 UTC (permalink / raw)


       I've been googling for answers, but can't figure out what to call
       the windows key.

Do:
man xev

then:
xev
<windows>
C-c
-- 
Sean Sieger

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
@ 2005-08-14  2:35 Sean Sieger
  0 siblings, 0 replies; 18+ messages in thread
From: Sean Sieger @ 2005-08-14  2:35 UTC (permalink / raw)


       xev
       <windows>
       C-c

Pardon, not C-c: Alt-F4
-- 
Sean Sieger

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
       [not found] <mailman.3675.1123988380.20277.help-gnu-emacs@gnu.org>
@ 2005-08-14  4:44 ` Tyler
  2005-08-14  8:58   ` Friedrich Laher
                     ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Tyler @ 2005-08-14  4:44 UTC (permalink / raw)


hmm. Alt-F4 switches me to desktop four, as I'm running the fluxbox 
windows manager. I read the xev manual, but it was a little terse for my 
limited experience. From the xev output it appears as if my windows keys 
are called Super_L and Super_R, but when I try:

(global-set-key [Super_L-z] 'scroll-other-window-down)

nothing happens. Same result with just Super-z. What am I doing wrong? I 
have also tried with "s-z" to no effect.

Thanks,

Tyler


Sean Sieger wrote:
>        xev
>        <windows>
>        C-c
> 
> Pardon, not C-c: Alt-F4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-14  4:44 ` key binding with windows and menu keys Tyler
@ 2005-08-14  8:58   ` Friedrich Laher
  2005-08-14 17:48   ` Peter Dyballa
       [not found]   ` <mailman.3737.1124042549.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Friedrich Laher @ 2005-08-14  8:58 UTC (permalink / raw)


Some windowmanagers grab that event.

You might have to reassign the symbol sent by it with xkeycaps - but
thats systemwide then.

Tyler wrote:

> hmm. Alt-F4 switches me to desktop four, as I'm running the fluxbox 
> windows manager. I read the xev manual, but it was a little terse for 
> my limited experience. From the xev output it appears as if my windows 
> keys are called Super_L and Super_R, but when I try:
>
> (global-set-key [Super_L-z] 'scroll-other-window-down)
>
> nothing happens. Same result with just Super-z. What am I doing wrong? 
> I have also tried with "s-z" to no effect.
>
> Thanks,
>
> Tyler
>
>
> Sean Sieger wrote:
>
>>        xev
>>        <windows>
>>        C-c
>>
>> Pardon, not C-c: Alt-F4
>
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
>

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-14  4:44 ` key binding with windows and menu keys Tyler
  2005-08-14  8:58   ` Friedrich Laher
@ 2005-08-14 17:48   ` Peter Dyballa
       [not found]   ` <mailman.3737.1124042549.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2005-08-14 17:48 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 14.08.2005 um 06:44 schrieb Tyler:

> (global-set-key [Super_L-z] 'scroll-other-window-down)
>

Try it with lower case `s´, i.e. (global-set-key [s-z] 
'scroll-other-window-down).

Capital `S´ is the Shift key. So it's indeed C-M-S-v that scrolls the 
other window. (And C-M-v too, only in the other direction.)

--
Greetings

   Pete

Without vi there is only GNU Emacs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
       [not found]   ` <mailman.3737.1124042549.20277.help-gnu-emacs@gnu.org>
@ 2005-08-15  1:45     ` Tyler
  2005-08-15  5:41       ` Angelina Carlton
       [not found]       ` <mailman.3777.1124085510.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Tyler @ 2005-08-15  1:45 UTC (permalink / raw)


Thanks for the suggestion, but it didn't work either. I found a 
solution, although I still can't use my 'windows' key. Instead I use the 
alt-up and alt-down combo, which does what i wanted without using a 
previously assigned key combo or the mysterious windows key:

(global-set-key [M-up] 'scroll-other-window-down)
(global-set-key [M-down] 'scroll-other-window)

Thanks again for the help, and if anyone knows another way to get at the 
windows key...

Tyler



Peter Dyballa wrote:
> 
> Am 14.08.2005 um 06:44 schrieb Tyler:
> 
>> (global-set-key [Super_L-z] 'scroll-other-window-down)
>>
> 
> Try it with lower case `s´, i.e. (global-set-key [s-z] 
> 'scroll-other-window-down).
> 
> Capital `S´ is the Shift key. So it's indeed C-M-S-v that scrolls the 
> other window. (And C-M-v too, only in the other direction.)
> 
> -- 
> Greetings
> 
>   Pete
> 
> Without vi there is only GNU Emacs
> 
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-15  1:45     ` Tyler
@ 2005-08-15  5:41       ` Angelina Carlton
       [not found]       ` <mailman.3777.1124085510.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 18+ messages in thread
From: Angelina Carlton @ 2005-08-15  5:41 UTC (permalink / raw)


Tyler <tyler.smith@mail.mcgill.ca> writes:
> Thanks again for the help, and if anyone knows another way to get at
> the windows key...

I asked in irc about this and for me, on Debian unstable this works:

run xkbprint :0.0 /tmp/o.ps
this makes a diagram of your layout

gv /tmp/o.ps
take a look at what the keys are, my left logo key is F13 key 115,
my right logo key is Super_R key 116

so the command:
xmodmap -e "keycode 115 = F13" enables the left logo key 
(i placed this command in my xfce4 start up script)

Then in my .emacs

;; Jump to other window
(global-set-key [(f13)] 'other-window)

hopefully that works for you too.

(thank you edrx in irc!)

-- 
-----Angelina Carlton-----
orchid on irc.freenode.net
     brat@magma.ca
web:bzgirl.bakadigital.com
--------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
       [not found]       ` <mailman.3777.1124085510.20277.help-gnu-emacs@gnu.org>
@ 2005-08-15 13:09         ` Tyler
  2005-08-15 14:35           ` Angelina Carlton
  0 siblings, 1 reply; 18+ messages in thread
From: Tyler @ 2005-08-15 13:09 UTC (permalink / raw)


Wow, that's perfect! It works just as you said, and it's a great idea to
have it bound to the other-window command as well. Thanks for the tip!

Tyler

Angelina Carlton wrote:
> Tyler <tyler.smith@mail.mcgill.ca> writes:
> 
>>Thanks again for the help, and if anyone knows another way to get at
>>the windows key...
> 
> 
> I asked in irc about this and for me, on Debian unstable this works:
> 
> run xkbprint :0.0 /tmp/o.ps
> this makes a diagram of your layout
> 
> gv /tmp/o.ps
> take a look at what the keys are, my left logo key is F13 key 115,
> my right logo key is Super_R key 116
> 
> so the command:
> xmodmap -e "keycode 115 = F13" enables the left logo key 
> (i placed this command in my xfce4 start up script)
> 
> Then in my .emacs
> 
> ;; Jump to other window
> (global-set-key [(f13)] 'other-window)
> 
> hopefully that works for you too.
> 
> (thank you edrx in irc!)
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-15 13:09         ` Tyler
@ 2005-08-15 14:35           ` Angelina Carlton
  2005-08-15 15:12             ` Peter Dyballa
       [not found]             ` <mailman.3819.1124119132.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 18+ messages in thread
From: Angelina Carlton @ 2005-08-15 14:35 UTC (permalink / raw)


Tyler <tyler.smith@mail.mcgill.ca> writes:

> Wow, that's perfect! It works just as you said, and it's a great idea to
> have it bound to the other-window command as well. Thanks for the tip!
>
There is one problem however, 2 of my computers do not run X and
consequently do not have the xmodmap command. So If I am working on them
in the console or via ssh I have to maintain my old key binding and try
to remember not to press the windows logo key instead.

I will try to figure out how to enable these keys in non X environment an
let you know, perhaps someone already knows how to do this?


-- 
-----Angelina Carlton-----
orchid on irc.freenode.net
     brat@magma.ca
web:bzgirl.bakadigital.com
--------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-15 14:35           ` Angelina Carlton
@ 2005-08-15 15:12             ` Peter Dyballa
  2005-08-16 13:21               ` Angelina Carlton
       [not found]             ` <mailman.3819.1124119132.20277.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 18+ messages in thread
From: Peter Dyballa @ 2005-08-15 15:12 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 15.08.2005 um 16:35 schrieb Angelina Carlton:

> There is one problem however, 2 of my computers do not run X and
> consequently do not have the xmodmap command. So If I am working on 
> them
> in the console or via ssh I have to maintain my old key binding and try
> to remember not to press the windows logo key instead.
>
> I will try to figure out how to enable these keys in non X environment 
> an
> let you know, perhaps someone already knows how to do this?
>

Is C-h k <Windows key+another key> returns just <another key>?

If not, you could by hand 'M-x global-set-key <the combination> RET 
scroll-other-window RET C-x ESC ESC C-a C-k C-g' -- bind the key and 
start to repeat-previous-command. The cursor goes into the minibuffer, 
where you put it at the beginning and then kill the whole line. Now an 
interrupt, and you're ready to yank/paste the valid ELisp expression 
into .emacs ... it wouldn't look pretty with a number instead of 
symbols (that's what I am used from X11 or Apple's Aqua), but it would 
work.

--
Greetings

   Pete

Without vi there is only GNU Emacs

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
       [not found]             ` <mailman.3819.1124119132.20277.help-gnu-emacs@gnu.org>
@ 2005-08-15 22:59               ` Tyler
  2005-08-16  8:49                 ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Tyler @ 2005-08-15 22:59 UTC (permalink / raw)


Thanks Pete, that's great. I've now got access to the windows keys, 
either by labelling them with xmodmap or using the quoted number. The 
only problem now is figuring out which keys to bind to which commands!

Tyler

Peter Dyballa wrote:
> 
> Am 15.08.2005 um 16:35 schrieb Angelina Carlton:
> 
>> There is one problem however, 2 of my computers do not run X and
>> consequently do not have the xmodmap command. So If I am working on them
>> in the console or via ssh I have to maintain my old key binding and try
>> to remember not to press the windows logo key instead.
>>
>> I will try to figure out how to enable these keys in non X environment an
>> let you know, perhaps someone already knows how to do this?
>>
> 
> Is C-h k <Windows key+another key> returns just <another key>?
> 
> If not, you could by hand 'M-x global-set-key <the combination> RET 
> scroll-other-window RET C-x ESC ESC C-a C-k C-g' -- bind the key and 
> start to repeat-previous-command. The cursor goes into the minibuffer, 
> where you put it at the beginning and then kill the whole line. Now an 
> interrupt, and you're ready to yank/paste the valid ELisp expression 
> into .emacs ... it wouldn't look pretty with a number instead of symbols 
> (that's what I am used from X11 or Apple's Aqua), but it would work.
> 
> -- 
> Greetings
> 
>   Pete
> 
> Without vi there is only GNU Emacs
> 
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-15 22:59               ` Tyler
@ 2005-08-16  8:49                 ` Peter Dyballa
  0 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2005-08-16  8:49 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 16.08.2005 um 00:59 schrieb Tyler:

> The only problem now is figuring out which keys to bind to which 
> commands!

Yeah -- this can give some headache!

--
Greetings

   Pete
               <\
                 \__     O                       __O
                 | O\   _\\/\-%                _`\<,
                 '()-'-(_)--(_)               (_)/(_)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-15 15:12             ` Peter Dyballa
@ 2005-08-16 13:21               ` Angelina Carlton
  2005-08-16 17:33                 ` Peter Dyballa
  0 siblings, 1 reply; 18+ messages in thread
From: Angelina Carlton @ 2005-08-16 13:21 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Is C-h k <Windows key+another key> returns just <another key>?

For me it returns: ~ 
That is, if I press win-logo in a writable buffer, it prints a ~ and
beeps my terminal. If the buffer is not writable it simply beeps.

> If not, you could by hand 'M-x global-set-key <the combination> RET
> scroll-other-window RET C-x ESC ESC C-a C-k C-g' -- bind the key and
> start to repeat-previous-command. The cursor goes into the minibuffer,
> where you put it at the beginning and then kill the whole line. Now an
> interrupt, and you're ready to yank/paste the valid ELisp expression
> into .emacs ... it wouldn't look pretty with a number instead of
> symbols (that's what I am used from X11 or Apple's Aqua), but it would
> work.

So trying by hand, M-x global-set-key NET <virology> NET
puts this in my mini buffer:

Set key ESC [ 2 5 to command: ~ 

I deleted the ~ and typed other-window and then did the 
ESC ESC stuff you mentioned. to get:

Redo: (global-set-key "^[[25" (quote other-window))

So i have tried in my .mics:
(global-set-key "^[[25" (quote other-window))
and
(global-set-key "^[[25" 'other-window)

And now it does switch windows but prints the tilde also :-\

How can get rid of the tilde? 

Thanks for the help!

-- 
-----Angelina Carlton-----
orchid on irc.freenode.net
     brat@magma.ca
web:bzgirl.bakadigital.com
--------------------------

>  LocalWords:  ESC

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-16 13:21               ` Angelina Carlton
@ 2005-08-16 17:33                 ` Peter Dyballa
  2005-08-16 18:41                   ` Angelina Carlton
                                     ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Peter Dyballa @ 2005-08-16 17:33 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 16.08.2005 um 15:21 schrieb Angelina Carlton:

>> Is C-h k <Windows key+another key> returns just <another key>?
>
> For me it returns: ~
> That is, if I press win-logo in a writable buffer, it prints a ~ and
> beeps my terminal. If the buffer is not writable it simply beeps.
>

For me it's not clear whether you really press two keys ...

The Windows key is presumed to be some modifier key, like Shift, Meta, 
Control, super, or hyper. (It does not work alone, only when pressed 
with one another non-modifier key.) What this key is doing is easy to 
find out: in *scratch* buffer C-q <Windows key>. It there is nothing 
coming, i.e. you see in minibuffer C-q- constantly, then it *is* a 
modifier key (press <any key> to finish input). You can now go to check 
what input is produced when you press C-q <Windows key+another key> ...

If you see something like ESC [ 2 5 ~ then your keyboard is in some 
ANSI/vt keyboard mode. lisp/term/lk201.el already contains a definition 
for that key:

	(define-key function-key-map "\e[25~" [f13])

So you should try to load/require that ELisp file in .emacs (if it does 
not get loaded automatically; check the *Messages* buffer for that). 
Then you have that key defined as f13. Now you can bind f13 to some 
function ...

--
Greetings

   Pete

   It's not the valleys in life I dread so much as the dips.
		-- 	Garfield

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-16 17:33                 ` Peter Dyballa
@ 2005-08-16 18:41                   ` Angelina Carlton
  2005-08-17 11:09                   ` Peter Dyballa
       [not found]                   ` <mailman.4032.1124278522.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Angelina Carlton @ 2005-08-16 18:41 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> For me it's not clear whether you really press two keys ...

Yes sorry I wasn't clear, it wont even register the second key press and
went immediately to describing the first key press.

> The Windows key is presumed to be some modifier key, like Shift, Meta,
> Control, super, or hyper. (It does not work alone, only when pressed
> with one another non-modifier key.) What this key is doing is easy to
> find out: in *scratch* buffer C-q <Windows key>. It there is nothing
> coming, i.e. you see in minibuffer C-q- constantly, then it *is* a
> modifier key (press <any key> to finish input). You can now go to
> check what input is produced when you press C-q <Windows key+another
> key> ...

> If you see something like ESC [ 2 5 ~ then your keyboard is in some
> ANSI/vt keyboard mode. lisp/term/lk201.el already contains a
> definition for that key:

> 	(define-key function-key-map "\e[25~" [f13])
>
This works perfectly. Thank you very for the help!
-- 
-----Angelina Carlton-----
orchid on irc.freenode.net
     brat@magma.ca
web:bzgirl.bakadigital.com
--------------------------

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
  2005-08-16 17:33                 ` Peter Dyballa
  2005-08-16 18:41                   ` Angelina Carlton
@ 2005-08-17 11:09                   ` Peter Dyballa
       [not found]                   ` <mailman.4032.1124278522.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Peter Dyballa @ 2005-08-17 11:09 UTC (permalink / raw)
  Cc: emacs list

Hello!

Have you both tried too to bind the function scroll-other-window-down 
to a key? Maybe Shift-<Windows key> or Shift-<Windows key + the other 
key>?

I often scroll back ...

--
Greetings

   Pete

"engineer: a mechanism for converting caffeine into designs"

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: key binding with windows and menu keys
       [not found]                   ` <mailman.4032.1124278522.20277.help-gnu-emacs@gnu.org>
@ 2005-08-17 13:13                     ` Tyler
  0 siblings, 0 replies; 18+ messages in thread
From: Tyler @ 2005-08-17 13:13 UTC (permalink / raw)
  Cc: emacs list

Yes, that's what got me started on this little project in the first 
place. I've now got scroll-other-window(-down) bound to M-down and M-up, 
respectively, as well as to <windows>-, and <windows>-.  with switch to 
other window on <windows>-/. When I decide which way I like it best I'll 
delete the extra bindings, and I'm going to add something for C-x b, 
which I also use alot.

Thanks again for your help!

Tyler


Peter Dyballa wrote:
> Hello!
> 
> Have you both tried too to bind the function scroll-other-window-down to 
> a key? Maybe Shift-<Windows key> or Shift-<Windows key + the other key>?
> 
> I often scroll back ...
> 
> -- 
> Greetings
> 
>   Pete
> 
> "engineer: a mechanism for converting caffeine into designs"
> 
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2005-08-17 13:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.3675.1123988380.20277.help-gnu-emacs@gnu.org>
2005-08-14  4:44 ` key binding with windows and menu keys Tyler
2005-08-14  8:58   ` Friedrich Laher
2005-08-14 17:48   ` Peter Dyballa
     [not found]   ` <mailman.3737.1124042549.20277.help-gnu-emacs@gnu.org>
2005-08-15  1:45     ` Tyler
2005-08-15  5:41       ` Angelina Carlton
     [not found]       ` <mailman.3777.1124085510.20277.help-gnu-emacs@gnu.org>
2005-08-15 13:09         ` Tyler
2005-08-15 14:35           ` Angelina Carlton
2005-08-15 15:12             ` Peter Dyballa
2005-08-16 13:21               ` Angelina Carlton
2005-08-16 17:33                 ` Peter Dyballa
2005-08-16 18:41                   ` Angelina Carlton
2005-08-17 11:09                   ` Peter Dyballa
     [not found]                   ` <mailman.4032.1124278522.20277.help-gnu-emacs@gnu.org>
2005-08-17 13:13                     ` Tyler
     [not found]             ` <mailman.3819.1124119132.20277.help-gnu-emacs@gnu.org>
2005-08-15 22:59               ` Tyler
2005-08-16  8:49                 ` Peter Dyballa
2005-08-14  2:35 Sean Sieger
  -- strict thread matches above, loose matches on Subject: below --
2005-08-14  2:23 Sean Sieger
2005-08-14  1:18 Tyler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).