help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to bind <lwindow>-; with a function on windows?


From: B. T. Raven
Subject: Re: How to bind <lwindow>-; with a function on windows?
Date: Sun, 26 Oct 2008 20:56:53 -0600
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Lennart Borgman wrote:
On Sun, Oct 26, 2008 at 5:23 PM, B. T. Raven <nihil@nihilo.net> wrote:
anhnmncb wrote:
When I type M-x global-set-key RET, then press <lwindow>, the help
window pops up and show:

<rwindow> runs the command ignore, which is an interactive compiled
Lisp function in `subr.el'.

It is bound to <mouse-movement>, <language-change>, <lwindow>,
<rwindow>.

I have no chance to press <lwindow>-; to function. Type them in emacs
window just produce a ;.



If you put this in your .emacs:

(setq w32-pass-lwindow-to-system nil
     w32-pass-rwindow-to-system nil
     w32-pass-apps-to-system    nil
     w32-lwindow-modifier       'super   ;; Left Windows
     w32-rwindow-modifier       'super   ;; Right Windows
     w32-apps-modifier          'hyper)  ;; App-Menu (key to right of Right
Windows)

then you will be able to use these bottom row keys as modifiers but you
still won't be able to bind a function to the bare key (lwindow for
example). You could however bind the function to Super- [a through z] or
even combinations of Ctl, Meta, Super, and Hyper:

(global-set-key [(super w)] 'foo)

As Lennart notes there are some combinations that Windows will trap at the
OS level but some of these are useful. Alt-tab will switch focus between
emacs and some other app from which you may want to copy-paste for example.

There are more combinations than Alt-Tab that Windows will trap. For
example on my pc if I do

  (global-set-key [(super ?e)]
       (lambda() (interactive) (message "called super E")))

This does not work, lwindow+e will still show Windows Explorer.

That is correct according to MS documentation which says you can not
rely on rebinding lwindow/rwindow without a low level keyboard hook.
Sometimes it works, sometimes it doesn't.



True if you replace the first "sometimes" with "usually." Super (i.e. windowskey) d, u, f, r (all unshifted) also don't work but the rest of the combinations do. Alt-Tab can't be trapped but it's useful; Alt-F4 is fatal. Ctl-Esc brings up start menu but most if not all other combinations are open for Emacs use. In fact with the hyper key combos (appkey) I got H-whatever undefined with all tested key combos.

Ed


reply via email to

[Prev in Thread] Current Thread [Next in Thread]