aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/msdos.texi81
1 files changed, 54 insertions, 27 deletions
diff --git a/doc/emacs/msdos.texi b/doc/emacs/msdos.texi
index 6ad12d646a1..a87561ccf18 100644
--- a/doc/emacs/msdos.texi
+++ b/doc/emacs/msdos.texi
@@ -507,32 +507,64 @@ the variable @code{w32-alt-is-meta} to a @code{nil} value.
507@findex w32-register-hot-key 507@findex w32-register-hot-key
508@findex w32-unregister-hot-key 508@findex w32-unregister-hot-key
509 MS-Windows reserves certain key combinations, such as 509 MS-Windows reserves certain key combinations, such as
510@kbd{@key{Alt}-@key{TAB}}, for its own use. These key combinations are 510@kbd{@key{Alt}-@key{TAB}} and a number of Windows key combinations,
511intercepted by the system before Emacs can see them. You can use the 511for its own use. These key combinations are intercepted by the system
512@code{w32-register-hot-key} function to allow a key sequence to be 512before Emacs can see them. Also, on Windows 10, all Windows key
513seen by Emacs instead of being grabbed by Windows. This function 513combinations are reserved by the system in such a way that they are
514registers a key sequence as a @dfn{hot key}, overriding the special 514never propagated to applications, even if the system does not
515meaning of that key sequence for Windows. (MS-Windows is told that 515currently define a hotkey on the specific combination. You can use
516the key sequence is a hot key only when one of the Emacs windows has 516the @code{w32-register-hot-key} function to allow a key sequence to be
517focus, so that the special keys still have their usual meaning for 517seen by Emacs instead of being grabbed by Windows. When registered as
518other Windows applications.) 518a hot key, the key combination is pulled out of the system's input
519 519queue before it is handled by Windows, effectively overriding the
520 The argument to @code{w32-register-hot-key} must be a single key, 520special meaning of that key sequence for Windows. The override is
521with or without modifiers, in vector form that would be acceptable to 521only effective when Emacs is active; with other applications on the
522@code{define-key}. The meta modifier is interpreted as the @key{Alt} 522foreground the keys behave normally.
523key if @code{w32-alt-is-meta} is @code{t} (the default), and the hyper 523
524modifier is always interpreted as the Windows key (usually labeled 524 The argument to @code{w32-register-hot-key} must be a single key with a
525with @key{start} and the Windows logo). If the function succeeds in 525single modifier, in vector form that would be acceptable to
526registering the key sequence, it returns the hotkey ID, a number; 526@code{define-key}. The control and shift modifiers have no effect on the
527otherwise it returns @code{nil}. 527argument. The meta modifier is interpreted as the @key{Alt} key if
528@code{w32-alt-is-meta} is @code{t} (the default), and the super and hyper
529modifiers are interpreted according to the bindings of
530@code{w32-lwindow-modifier} and @code{w32-rwindow-modifier}. Additionally, a
531modifier with the trailing dash but with no key indicates that all
532Windows defined hotkeys for that modifier are to be overridden in the
533favor of Emacs.
528 534
529@kindex M-TAB@r{, (MS-Windows)} 535@kindex M-TAB@r{, (MS-Windows)}
530@cindex @kbd{M-@key{TAB}} vs @kbd{@key{Alt}-@key{TAB}} (MS-Windows) 536@cindex @kbd{M-@key{TAB}} vs @kbd{@key{Alt}-@key{TAB}} (MS-Windows)
531@cindex @kbd{@key{Alt}-@key{TAB}} vs @kbd{M-@key{TAB}} (MS-Windows) 537@cindex @kbd{@key{Alt}-@key{TAB}} vs @kbd{M-@key{TAB}} (MS-Windows)
532 For example, @code{(w32-register-hot-key [M-tab])} lets you use 538 For example, @code{(w32-register-hot-key [M-tab])} lets you use
533@kbd{M-@key{TAB}} normally in Emacs; for instance, to complete the word or 539@kbd{M-@key{TAB}} normally in Emacs; for instance, to complete the
534symbol at point at top level, or to complete the current search string 540word or symbol at point at top level, or to complete the current
535against previously sought strings during incremental search. 541search string against previously sought strings during incremental
542search. @code{(w32-register-hot-key [s-])} with
543@code{w32-lwindow-modifier} bound to @code{super} disables all the
544Windows' own Windows key based shortcuts.@footnote{There is one known
545exception: The combination @kbd{@key{Windows}-@key{L}} that locks the
546workstation is handled by the system on a lower level. For this
547reason, @code{w32-register-hot-key} cannot override this key
548combination - it always locks the computer.}
549
550 Note that @code{w32-register-hot-key} checks the
551@code{w32-[lr]window-modifier} values at the time of the function
552call. Thus, you can set @code{w32-lwindow-modifier} as @code{super},
553then call @code{(w32-register-hot-key [s-r])}, and finally set
554@code{w32-rwindow-modifier} as @code{super} as well. The result is
555that the left Windows key together with @key{R} invokes whichever
556function you have bound for the combination in Emacs, and the right
557Windows key and @key{R} opens the Windows @code{Run} dialog.
558
559 The hotkey registrations always also include all the shift and
560control modifier combinations for the given hotkey; that is,
561registering @kbd{s-@key{a}} as a hotkey gives you @kbd{S-s-@key{a}},
562@kbd{C-s-@key{a}} and @kbd{C-S-s-@key{a}} as well.
563
564 On Windows 98 and ME, the hotkey registration is more restricted.
565The desired hotkey must always be fully specified, and
566@code{w32-phantom-key-code} can be customized to achieve desired
567results.
536 568
537 The function @code{w32-unregister-hot-key} reverses the effect of 569 The function @code{w32-unregister-hot-key} reverses the effect of
538@code{w32-register-hot-key} for its argument key sequence. 570@code{w32-register-hot-key} for its argument key sequence.
@@ -607,12 +639,7 @@ keys are passed to Windows or swallowed by Emacs. If the value is
607otherwise it is passed to Windows. The default is @code{t} for both 639otherwise it is passed to Windows. The default is @code{t} for both
608of these variables. Passing each of these keys to Windows produces 640of these variables. Passing each of these keys to Windows produces
609its normal effect: for example, @kbd{@key{Lwindow}} opens the 641its normal effect: for example, @kbd{@key{Lwindow}} opens the
610@code{Start} menu, etc.@footnote{ 642@code{Start} menu, etc.
611Some combinations of the ``Windows'' keys with other keys are caught
612by Windows at a low level in a way that Emacs currently cannot prevent.
613For example, @kbd{@key{Lwindow} r} always pops up the Windows
614@samp{Run} dialog. Customizing the value of
615@code{w32-phantom-key-code} might help in some cases, though.}
616 643
617@vindex w32-recognize-altgr 644@vindex w32-recognize-altgr
618@kindex AltGr @r{(MS-Windows)} 645@kindex AltGr @r{(MS-Windows)}