unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to bind <lwindow>-; with a function on windows?
@ 2008-10-26  3:08 anhnmncb
  2008-10-26 10:15 ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: anhnmncb @ 2008-10-26  3:08 UTC (permalink / raw)
  To: help-gnu-emacs

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 ;.





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

* Re: How to bind <lwindow>-; with a function on windows?
  2008-10-26  3:08 anhnmncb
@ 2008-10-26 10:15 ` Lennart Borgman
  2008-10-26 12:14   ` anhnmncb
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2008-10-26 10:15 UTC (permalink / raw)
  To: anhnmncb; +Cc: help-gnu-emacs

On Sun, Oct 26, 2008 at 4:08 AM, anhnmncb <anhnmncb@sina.com> 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 ;.

Some keys and key combinations on ms windows can not be used in
(unpatched) Emacs because they must be caught on a lower level than
Emacs currently binds them.

If you want to bind these keys then you can try the patched version of
EmacsW32+Emacs, see EmacsWiki.




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

* Re: How to bind <lwindow>-; with a function on windows?
  2008-10-26 10:15 ` Lennart Borgman
@ 2008-10-26 12:14   ` anhnmncb
  0 siblings, 0 replies; 8+ messages in thread
From: anhnmncb @ 2008-10-26 12:14 UTC (permalink / raw)
  To: help-gnu-emacs

hmm, thanks for info.





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

* Re: How to bind <lwindow>-; with a function on windows?
       [not found] <mailman.2108.1224990559.25473.help-gnu-emacs@gnu.org>
@ 2008-10-26 16:23 ` B. T. Raven
  2008-10-26 22:13   ` Lennart Borgman
                     ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: B. T. Raven @ 2008-10-26 16:23 UTC (permalink / raw)
  To: help-gnu-emacs

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.

Ed


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

* Re: How to bind <lwindow>-; with a function on windows?
  2008-10-26 16:23 ` How to bind <lwindow>-; with a function on windows? B. T. Raven
@ 2008-10-26 22:13   ` Lennart Borgman
       [not found]   ` <mailman.2136.1225059214.25473.help-gnu-emacs@gnu.org>
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2008-10-26 22:13 UTC (permalink / raw)
  To: B. T. Raven; +Cc: help-gnu-emacs

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.




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

* Re: How to bind <lwindow>-; with a function on windows?
       [not found]   ` <mailman.2136.1225059214.25473.help-gnu-emacs@gnu.org>
@ 2008-10-27  2:56     ` B. T. Raven
  0 siblings, 0 replies; 8+ messages in thread
From: B. T. Raven @ 2008-10-27  2:56 UTC (permalink / raw)
  To: help-gnu-emacs

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


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

* Re: How to bind <lwindow>-; with a function on windows?
  2008-10-26 16:23 ` How to bind <lwindow>-; with a function on windows? B. T. Raven
  2008-10-26 22:13   ` Lennart Borgman
       [not found]   ` <mailman.2136.1225059214.25473.help-gnu-emacs@gnu.org>
@ 2008-10-27  5:25   ` anhnmncb
       [not found]   ` <mailman.2149.1225085142.25473.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 8+ messages in thread
From: anhnmncb @ 2008-10-27  5:25 UTC (permalink / raw)
  To: help-gnu-emacs

"B. T. Raven" <nihil@nihilo.net> writes:

> 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.
>
> Ed

Wow, it works, many thanks.





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

* Re: How to bind <lwindow>-; with a function on windows?
       [not found]   ` <mailman.2149.1225085142.25473.help-gnu-emacs@gnu.org>
@ 2008-10-27 18:43     ` B. T. Raven
  0 siblings, 0 replies; 8+ messages in thread
From: B. T. Raven @ 2008-10-27 18:43 UTC (permalink / raw)
  To: help-gnu-emacs

anhnmncb wrote:
> "B. T. Raven" <nihil@nihilo.net> writes:
> 
>> 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.
>>
>> Ed
> 
> Wow, it works, many thanks.
> 
> 
> 
Good. Btw, I was wrong about M-f4 (alt-f4)which seems to unconditionally 
kill the current process in Windows. In Emacs that doesn't happen. Both 
C-F4 and M-F4 can be mapped to functions.

Ed


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

end of thread, other threads:[~2008-10-27 18:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2108.1224990559.25473.help-gnu-emacs@gnu.org>
2008-10-26 16:23 ` How to bind <lwindow>-; with a function on windows? B. T. Raven
2008-10-26 22:13   ` Lennart Borgman
     [not found]   ` <mailman.2136.1225059214.25473.help-gnu-emacs@gnu.org>
2008-10-27  2:56     ` B. T. Raven
2008-10-27  5:25   ` anhnmncb
     [not found]   ` <mailman.2149.1225085142.25473.help-gnu-emacs@gnu.org>
2008-10-27 18:43     ` B. T. Raven
2008-10-26  3:08 anhnmncb
2008-10-26 10:15 ` Lennart Borgman
2008-10-26 12:14   ` anhnmncb

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).