diff options
| author | Paul Eggert | 2016-04-24 12:48:34 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-24 12:48:34 -0700 |
| commit | f7794460e8e9e0c514b0cb01dd010b531c21169c (patch) | |
| tree | 4bc195ab38f3e0e106b21b02d080be558ba80b33 /src/w32fns.c | |
| parent | e6d6a99455183bca5074b7601ad11d424da6442e (diff) | |
| parent | 78f9af707f711121ba24d8dce88d6757683a4dfe (diff) | |
| download | emacs-f7794460e8e9e0c514b0cb01dd010b531c21169c.tar.gz emacs-f7794460e8e9e0c514b0cb01dd010b531c21169c.zip | |
Merge from origin/emacs-25
78f9af7 ; ChangeLog fixes
162e549 * admin/authors.el (authors-ignored-files): Additions.
2b31a0c In x_set_window_size restore do_pending_window_change calls
401857e Fix Alt-modified keys on some European MS-Windows keyboards
a77cf24 Document 'help-go-forward'
1ba947f Revert "Allow to customize names of executables used by grep.el"
570e0fa Revert "Don't use 'find-program'"
645f4ef Revert "Use 'grep-find-program' in check-declare.el"
aa03257 Clarify documentation of 'dired-mark-files-containing-regexp'
ce0d8c7 Make tmm-menubar work in correct order again
b8d5a8f Remove the Meta-CVS VC backend
Diffstat (limited to 'src/w32fns.c')
| -rw-r--r-- | src/w32fns.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 111f1fb6562..ede8f6be292 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -3540,9 +3540,45 @@ deliver_wm_chars (int do_translate, HWND hwnd, UINT msg, UINT wParam, | |||
| 3540 | SHORT r = VkKeyScanW (*b), bitmap = 0x1FF; | 3540 | SHORT r = VkKeyScanW (*b), bitmap = 0x1FF; |
| 3541 | 3541 | ||
| 3542 | FPRINTF_WM_CHARS((stderr, "VkKeyScanW %#06x %#04x\n", (int)r, | 3542 | FPRINTF_WM_CHARS((stderr, "VkKeyScanW %#06x %#04x\n", (int)r, |
| 3543 | wParam)); | 3543 | wParam)); |
| 3544 | if ((r & 0xFF) == wParam) | 3544 | if ((r & 0xFF) == wParam) |
| 3545 | bitmap = r>>8; /* *b is reachable via simple interface */ | 3545 | bitmap = r>>8; /* *b is reachable via simple interface */ |
| 3546 | else | ||
| 3547 | { | ||
| 3548 | /* VkKeyScanW() (essentially) returns the FIRST key with | ||
| 3549 | the specified character; so here the pressed key is the | ||
| 3550 | SECONDARY key producing the character. | ||
| 3551 | |||
| 3552 | Essentially, we have no information about the "role" of | ||
| 3553 | modifiers on this key: which contribute into the | ||
| 3554 | produced character (so "are consumed"), and which are | ||
| 3555 | "extra" (must attache to bindable events). | ||
| 3556 | |||
| 3557 | The default above would consume ALL modifiers, so the | ||
| 3558 | character is reported "as is". However, on many layouts | ||
| 3559 | the ordering of the keys (in the layout table) is not | ||
| 3560 | thought out well, so the "secondary" keys are often those | ||
| 3561 | which the users would prefer to use with Alt-CHAR. | ||
| 3562 | (Moreover - with e.g. Czech-QWERTY - the ASCII | ||
| 3563 | punctuation is accessible from two equally [nu]preferable | ||
| 3564 | AltGr-keys.) | ||
| 3565 | |||
| 3566 | SO: Heuristic: if the reported char is ASCII, AND Meta | ||
| 3567 | modifier is a candidate, behave as if Meta is present | ||
| 3568 | (fallback to the legacy branch; bug#23251). | ||
| 3569 | |||
| 3570 | (This would break layouts | ||
| 3571 | - delivering ASCII characters | ||
| 3572 | - on SECONDARY keys | ||
| 3573 | - with not Shift/AltGr-like modifier combinations. | ||
| 3574 | All 3 conditions together must be pretty exotic | ||
| 3575 | cases - and a workaround exists: use "primary" keys!) */ | ||
| 3576 | if (*b < 0x80 | ||
| 3577 | && (wmsg.dwModifiers | ||
| 3578 | & (alt_modifier | meta_modifier | ||
| 3579 | | super_modifier | hyper_modifier))) | ||
| 3580 | return 0; | ||
| 3581 | } | ||
| 3546 | if (*type_CtrlAlt == 'a') /* Simple Alt seen */ | 3582 | if (*type_CtrlAlt == 'a') /* Simple Alt seen */ |
| 3547 | { | 3583 | { |
| 3548 | if ((bitmap & ~1) == 0) /* 1: KBDSHIFT */ | 3584 | if ((bitmap & ~1) == 0) /* 1: KBDSHIFT */ |