Skip to content

Commit e43a221

Browse files
committed
Send proper key codes for KeyEvents to WebKit.
A few KeyEvents to key code mappings were incorrect or missing. Fix them. Change-Id: I74087768fddd467993f04ed8b4c2dc6345d20e8a Task-number: QTBUG-50354 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
1 parent 7a39d2c commit e43a221

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/web_event_factory.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,10 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
264264
case Qt::Key_Help:
265265
return VK_HELP; // (2F) HELP key
266266
case Qt::Key_0:
267-
case Qt::Key_ParenLeft:
267+
case Qt::Key_ParenRight:
268268
return VK_0; // (30) 0) key
269269
case Qt::Key_1:
270+
case Qt::Key_Exclam:
270271
return VK_1; // (31) 1 ! key
271272
case Qt::Key_2:
272273
case Qt::Key_At:
@@ -290,7 +291,7 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
290291
case Qt::Key_Asterisk:
291292
return VK_8; // (38) 8 key '*'
292293
case Qt::Key_9:
293-
case Qt::Key_ParenRight:
294+
case Qt::Key_ParenLeft:
294295
return VK_9; // (39) 9 key '('
295296
case Qt::Key_A:
296297
return VK_A; // (41) A key case 'a': case 'A': return 0x41;
@@ -428,6 +429,7 @@ static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
428429
case Qt::Key_BraceRight:
429430
return VK_OEM_6; // case ']': case '}': return 0xDD;
430431
// VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
432+
case Qt::Key_Apostrophe:
431433
case Qt::Key_QuoteDbl:
432434
return VK_OEM_7; // case '\'': case '"': return 0xDE;
433435
// VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.

0 commit comments

Comments
 (0)