diff options
author | wm4 <wm4@mplayer2.org> | 2012-04-14 18:22:12 +0200 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-04-14 18:29:28 +0200 |
commit | b6b09b23f6de76450de7539928757d89664e8c2b (patch) | |
tree | d40f96289c581c9fdaff140e3e74e01f3283aaed /libvo | |
parent | 3bb456b14d4c2b8e26c5d6f7bbfe62f5e97ed58e (diff) | |
download | mpv-b6b09b23f6de76450de7539928757d89664e8c2b.tar.bz2 mpv-b6b09b23f6de76450de7539928757d89664e8c2b.tar.xz |
win32: fix handling of AltGr
Windows implicitly enables Ctrl+Alt on AltGr. These modifiers are
unwanted for keys that have special mappings on AltGr.
Add warning about different behavior on wine.
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/w32_common.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 7eaafe7c29..ad8d1f453b 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -194,6 +194,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, case WM_SYSCHAR: { int mods = mod_state(vo); int code = wParam; + // Windows enables Ctrl+Alt when AltGr (VK_RMENU) is pressed. + // E.g. AltGr+9 on a German keyboard would yield Ctrl+Alt+[ + // Warning: wine handles this differently. Don't test this on wine! + if (key_state(vo, VK_RMENU)) + mods &= ~(KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT); // Apparently Ctrl+A to Ctrl+Z is special cased, and produces // character codes from 1-26. Work it around. // Also, enter/return (including the keypad variant) and CTRL+J both |