diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/msdos.texi | 81 |
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, |
| 511 | intercepted by the system before Emacs can see them. You can use the | 511 | for 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 | 512 | before Emacs can see them. Also, on Windows 10, all Windows key |
| 513 | seen by Emacs instead of being grabbed by Windows. This function | 513 | combinations are reserved by the system in such a way that they are |
| 514 | registers a key sequence as a @dfn{hot key}, overriding the special | 514 | never propagated to applications, even if the system does not |
| 515 | meaning of that key sequence for Windows. (MS-Windows is told that | 515 | currently define a hotkey on the specific combination. You can use |
| 516 | the key sequence is a hot key only when one of the Emacs windows has | 516 | the @code{w32-register-hot-key} function to allow a key sequence to be |
| 517 | focus, so that the special keys still have their usual meaning for | 517 | seen by Emacs instead of being grabbed by Windows. When registered as |
| 518 | other Windows applications.) | 518 | a hot key, the key combination is pulled out of the system's input |
| 519 | 519 | queue before it is handled by Windows, effectively overriding the | |
| 520 | The argument to @code{w32-register-hot-key} must be a single key, | 520 | special meaning of that key sequence for Windows. The override is |
| 521 | with or without modifiers, in vector form that would be acceptable to | 521 | only effective when Emacs is active; with other applications on the |
| 522 | @code{define-key}. The meta modifier is interpreted as the @key{Alt} | 522 | foreground the keys behave normally. |
| 523 | key if @code{w32-alt-is-meta} is @code{t} (the default), and the hyper | 523 | |
| 524 | modifier 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 |
| 525 | with @key{start} and the Windows logo). If the function succeeds in | 525 | single modifier, in vector form that would be acceptable to |
| 526 | registering the key sequence, it returns the hotkey ID, a number; | 526 | @code{define-key}. The control and shift modifiers have no effect on the |
| 527 | otherwise it returns @code{nil}. | 527 | argument. 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 | ||
| 529 | modifiers are interpreted according to the bindings of | ||
| 530 | @code{w32-lwindow-modifier} and @code{w32-rwindow-modifier}. Additionally, a | ||
| 531 | modifier with the trailing dash but with no key indicates that all | ||
| 532 | Windows defined hotkeys for that modifier are to be overridden in the | ||
| 533 | favor 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 |
| 534 | symbol at point at top level, or to complete the current search string | 540 | word or symbol at point at top level, or to complete the current |
| 535 | against previously sought strings during incremental search. | 541 | search string against previously sought strings during incremental |
| 542 | search. @code{(w32-register-hot-key [s-])} with | ||
| 543 | @code{w32-lwindow-modifier} bound to @code{super} disables all the | ||
| 544 | Windows' own Windows key based shortcuts.@footnote{There is one known | ||
| 545 | exception: The combination @kbd{@key{Windows}-@key{L}} that locks the | ||
| 546 | workstation is handled by the system on a lower level. For this | ||
| 547 | reason, @code{w32-register-hot-key} cannot override this key | ||
| 548 | combination - 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 | ||
| 552 | call. Thus, you can set @code{w32-lwindow-modifier} as @code{super}, | ||
| 553 | then call @code{(w32-register-hot-key [s-r])}, and finally set | ||
| 554 | @code{w32-rwindow-modifier} as @code{super} as well. The result is | ||
| 555 | that the left Windows key together with @key{R} invokes whichever | ||
| 556 | function you have bound for the combination in Emacs, and the right | ||
| 557 | Windows key and @key{R} opens the Windows @code{Run} dialog. | ||
| 558 | |||
| 559 | The hotkey registrations always also include all the shift and | ||
| 560 | control modifier combinations for the given hotkey; that is, | ||
| 561 | registering @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. | ||
| 565 | The desired hotkey must always be fully specified, and | ||
| 566 | @code{w32-phantom-key-code} can be customized to achieve desired | ||
| 567 | results. | ||
| 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 | |||
| 607 | otherwise it is passed to Windows. The default is @code{t} for both | 639 | otherwise it is passed to Windows. The default is @code{t} for both |
| 608 | of these variables. Passing each of these keys to Windows produces | 640 | of these variables. Passing each of these keys to Windows produces |
| 609 | its normal effect: for example, @kbd{@key{Lwindow}} opens the | 641 | its normal effect: for example, @kbd{@key{Lwindow}} opens the |
| 610 | @code{Start} menu, etc.@footnote{ | 642 | @code{Start} menu, etc. |
| 611 | Some combinations of the ``Windows'' keys with other keys are caught | ||
| 612 | by Windows at a low level in a way that Emacs currently cannot prevent. | ||
| 613 | For 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)} |