From 532a69c6fea4963c0ea1011270949fa92035a780 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 12 Jan 2016 13:38:12 +0100 Subject: Update key code mappings using QtWebkit mappings as reference. Copy additional key code mappings from PlatformKeyboardEventQt.cpp. Also add a mapping for missing numeric keypad equals key. Change-Id: Ia6c4413795293be84bcd8ea9d981d8cdfb94509b Task-number: QTBUG-50401 Reviewed-by: Joerg Bornemann --- src/core/web_event_factory.cpp | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'src/core/web_event_factory.cpp') diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 1306f6f3b..2e6fde214 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -109,6 +109,8 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad) return VK_DECIMAL; // (6E) Decimal key case Qt::Key_Slash: return VK_DIVIDE; // (6F) Divide key + case Qt::Key_Equal: + return VK_OEM_PLUS; // (BB) Equal key case Qt::Key_PageUp: return VK_PRIOR; // (21) PAGE UP key case Qt::Key_PageDown: @@ -376,13 +378,22 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad) // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key - // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key - // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key - // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key - // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key - // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key - // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key - // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key + + case Qt::Key_VolumeMute: + return VK_VOLUME_MUTE; // (AD) Windows 2000/XP: Volume Mute key + case Qt::Key_VolumeDown: + return VK_VOLUME_DOWN; // (AE) Windows 2000/XP: Volume Down key + case Qt::Key_VolumeUp: + return VK_VOLUME_UP; // (AF) Windows 2000/XP: Volume Up key + case Qt::Key_MediaNext: + return VK_MEDIA_NEXT_TRACK; // (B0) Windows 2000/XP: Next Track key + case Qt::Key_MediaPrevious: + return VK_MEDIA_PREV_TRACK; // (B1) Windows 2000/XP: Previous Track key + case Qt::Key_MediaStop: + return VK_MEDIA_STOP; // (B2) Windows 2000/XP: Stop Media key + case Qt::Key_MediaTogglePlayPause: + return VK_MEDIA_PLAY_PAUSE; // (B3) Windows 2000/XP: Play/Pause Media key + // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key @@ -434,6 +445,12 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad) return VK_OEM_7; // case '\'': case '"': return 0xDE; // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard + + case Qt::Key_AudioRewind: + return 0xE3; // (E3) Android/GoogleTV: Rewind media key (Windows: VK_ICO_HELP Help key on 1984 Olivetti M24 deluxe keyboard) + case Qt::Key_AudioForward: + return 0xE4; // (E4) Android/GoogleTV: Fast forward media key (Windows: VK_ICO_00 '00' key on 1984 Olivetti M24 deluxe keyboard) + // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP // VK_ATTN (F6) Attn key -- cgit v1.2.3