2
votes

I am trying to learn Emacs and trying to find best keyboard layout for me. One thing is really annoying me. I have added following lines to .emacs

(global-set-key "\C-y" 'scroll-up)
(global-set-key "\M-y" 'scroll-down)

When I hold Control and press y a few times, it will page down on every press of y.

However, when I hold the Windows key (mapped as Meta) and press y a few times it will only page up on the first press of y and all subsequent presses of y I get the ‘y’ character inserted in the buffer.

Can the page up behave like page down? I want to hold Meta and keep pressing y to scroll multiple pages up.

I am using GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2008-05-12 on LENNART-69DE564 (patched). It is Emacs with EmacsW32 patch. Is this problem with this Emacs? Problem with Meta key?

I tried original GNU Emacs (not patched) and it works OK with Alt. But my problem is not that I want to scroll without releasing any key. I release key y and press it multiple times but don't want to have to release Meta key. Same problem is described here:

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/f30f4b75a8b75b10

Problem is not in that I have changed key mapping. It looks like it is a bug in EmacsW32 version. Here is another description of the problem: Unreleased Meta/Win modifier

3

3 Answers

5
votes
  1. Use C-v and M-v.
  2. Don't change C-y, M-y default bindings.
4
votes

Could this be a side affect of using the Windows key as Meta? I'm thinking this because in a non-Emacs situation if you press and hold the Windows key and another key for a short cut (Win+E for Explorer, Win+R for Run dialog, etc.) the desired action only triggers once, not multiple times if you keep holding it down.

I'd try reassigning Meta to Alt and see if the problem persists. If it doesn't, then I'm not sure what other option you have, since likely it's the OS only sending the Windows key press once to the app in focus.

0
votes

You should use the patched EmacsW32 version, if you want the Windows key as Meta.

From the site about the patches:

"Changes that makes it possible to use the window keyboard keys as META in Emacs. Without this patch key sequences like E will always do what they by default does in windows, ie in this case open up Windows Explorer. (This patched is not used by default, you have to turn it on.)"