Changeset 60744 in webkit
- Timestamp:
- Jun 5, 2010 3:00:02 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r60743 r60744 1 2010-06-05 Anders Bakken <agbakken@gmail.com> 2 3 Reviewed by Eric Seidel. 4 5 [Qt] PlatformKeyboardEventQt.cpp has coding-style errors 6 https://bugs.webkit.org/show_bug.cgi?id=39770 7 8 * platform/qt/PlatformKeyboardEventQt.cpp: 9 (WebCore::keyIdentifierForQtKeyCode): 10 (WebCore::windowsKeyCodeForKeyEvent): 11 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): 12 1 13 2010-06-05 Anders Bakken <agbakken@gmail.com> 2 14 -
trunk/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
r56704 r60744 32 32 #include "WindowsKeyboardCodes.h" 33 33 34 #include <QKeyEvent> 34 35 #include <ctype.h> 35 36 #include <QKeyEvent>37 36 38 37 namespace WebCore { … … 41 40 { 42 41 switch (keyCode) { 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 42 case Qt::Key_Menu: 43 case Qt::Key_Alt: 44 return "Alt"; 45 case Qt::Key_Clear: 46 return "Clear"; 47 case Qt::Key_Down: 48 return "Down"; 49 case Qt::Key_End: 50 return "End"; 51 case Qt::Key_Return: 52 case Qt::Key_Enter: 53 return "Enter"; 54 case Qt::Key_Execute: 55 return "Execute"; 56 case Qt::Key_F1: 57 return "F1"; 58 case Qt::Key_F2: 59 return "F2"; 60 case Qt::Key_F3: 61 return "F3"; 62 case Qt::Key_F4: 63 return "F4"; 64 case Qt::Key_F5: 65 return "F5"; 66 case Qt::Key_F6: 67 return "F6"; 68 case Qt::Key_F7: 69 return "F7"; 70 case Qt::Key_F8: 71 return "F8"; 72 case Qt::Key_F9: 73 return "F9"; 74 case Qt::Key_F10: 75 return "F10"; 76 case Qt::Key_F11: 77 return "F11"; 78 case Qt::Key_F12: 79 return "F12"; 80 case Qt::Key_F13: 81 return "F13"; 82 case Qt::Key_F14: 83 return "F14"; 84 case Qt::Key_F15: 85 return "F15"; 86 case Qt::Key_F16: 87 return "F16"; 88 case Qt::Key_F17: 89 return "F17"; 90 case Qt::Key_F18: 91 return "F18"; 92 case Qt::Key_F19: 93 return "F19"; 94 case Qt::Key_F20: 95 return "F20"; 96 case Qt::Key_F21: 97 return "F21"; 98 case Qt::Key_F22: 99 return "F22"; 100 case Qt::Key_F23: 101 return "F23"; 102 case Qt::Key_F24: 103 return "F24"; 104 case Qt::Key_Help: 105 return "Help"; 106 case Qt::Key_Home: 107 return "Home"; 108 case Qt::Key_Insert: 109 return "Insert"; 110 case Qt::Key_Left: 111 return "Left"; 112 case Qt::Key_PageDown: 113 return "PageDown"; 114 case Qt::Key_PageUp: 115 return "PageUp"; 116 case Qt::Key_Pause: 117 return "Pause"; 118 case Qt::Key_Print: 119 return "PrintScreen"; 120 case Qt::Key_Right: 121 return "Right"; 122 case Qt::Key_Select: 123 return "Select"; 124 case Qt::Key_Up: 125 return "Up"; 126 // Standard says that DEL becomes U+007F. 127 case Qt::Key_Delete: 128 return "U+007F"; 129 case Qt::Key_Backspace: 130 return "U+0008"; 131 case Qt::Key_Tab: 132 return "U+0009"; 133 case Qt::Key_Backtab: 134 return "U+0009"; 135 default: 136 return String::format("U+%04X", toupper(keyCode)); 138 137 } 139 138 } … … 145 144 switch (keycode) { 146 145 case Qt::Key_0: 147 return VK_NUMPAD0; 146 return VK_NUMPAD0; // (60) Numeric keypad 0 key 148 147 case Qt::Key_1: 149 return VK_NUMPAD1; 148 return VK_NUMPAD1; // (61) Numeric keypad 1 key 150 149 case Qt::Key_2: 151 150 return VK_NUMPAD2; // (62) Numeric keypad 2 key 152 151 case Qt::Key_3: 153 return VK_NUMPAD3; 152 return VK_NUMPAD3; // (63) Numeric keypad 3 key 154 153 case Qt::Key_4: 155 return VK_NUMPAD4; 154 return VK_NUMPAD4; // (64) Numeric keypad 4 key 156 155 case Qt::Key_5: 157 return VK_NUMPAD5; 156 return VK_NUMPAD5; // (65) Numeric keypad 5 key 158 157 case Qt::Key_6: 159 return VK_NUMPAD6; 158 return VK_NUMPAD6; // (66) Numeric keypad 6 key 160 159 case Qt::Key_7: 161 return VK_NUMPAD7; 160 return VK_NUMPAD7; // (67) Numeric keypad 7 key 162 161 case Qt::Key_8: 163 return VK_NUMPAD8; 162 return VK_NUMPAD8; // (68) Numeric keypad 8 key 164 163 case Qt::Key_9: 165 return VK_NUMPAD9; 164 return VK_NUMPAD9; // (69) Numeric keypad 9 key 166 165 case Qt::Key_Asterisk: 167 166 return VK_MULTIPLY; // (6A) Multiply key 168 167 case Qt::Key_Plus: 169 return VK_ADD; 168 return VK_ADD; // (6B) Add key 170 169 case Qt::Key_Minus: 171 170 return VK_SUBTRACT; // (6D) Subtract key 172 171 case Qt::Key_Period: 173 return VK_DECIMAL; 172 return VK_DECIMAL; // (6E) Decimal key 174 173 case Qt::Key_Slash: 175 return VK_DIVIDE; 174 return VK_DIVIDE; // (6F) Divide key 176 175 case Qt::Key_PageUp: 177 176 return VK_PRIOR; // (21) PAGE UP key … … 197 196 198 197 switch (keycode) { 199 200 201 202 203 204 205 206 207 208 return VK_RETURN; //(0D) Return key209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 return VK_EXECUTE;// (2B) EXECUTE key311 //dunno on this312 //case Qt::Key_PrintScreen:313 //return VK_SNAPSHOT; // (2C) PRINT SCREEN key314 315 316 317 318 319 320 321 322 return VK_0; //(30) 0) key323 324 return VK_1; //(31) 1 ! key325 326 327 return VK_2; //(32) 2 & key328 329 330 return VK_3; //case '3': case '#';331 332 case Qt::Key_Dollar: //(34) 4 key '$';333 334 335 336 return VK_5; //(35) 5 key '%'337 338 339 return VK_6; //(36) 6 key '^'340 341 342 return VK_7; //(37) 7 key case '&'343 344 345 return VK_8; //(38) 8 key '*'346 347 348 return VK_9; //(39) 9 key '('349 350 return VK_A; //(41) A key case 'a': case 'A': return 0x41;351 352 return VK_B; //(42) B key case 'b': case 'B': return 0x42;353 354 return VK_C; //(43) C key case 'c': case 'C': return 0x43;355 356 return VK_D; //(44) D key case 'd': case 'D': return 0x44;357 358 return VK_E; //(45) E key case 'e': case 'E': return 0x45;359 360 return VK_F; //(46) F key case 'f': case 'F': return 0x46;361 362 return VK_G; //(47) G key case 'g': case 'G': return 0x47;363 364 return VK_H; //(48) H key case 'h': case 'H': return 0x48;365 366 return VK_I; //(49) I key case 'i': case 'I': return 0x49;367 368 return VK_J; //(4A) J key case 'j': case 'J': return 0x4A;369 370 return VK_K; //(4B) K key case 'k': case 'K': return 0x4B;371 372 return VK_L; //(4C) L key case 'l': case 'L': return 0x4C;373 374 return VK_M; //(4D) M key case 'm': case 'M': return 0x4D;375 376 return VK_N; //(4E) N key case 'n': case 'N': return 0x4E;377 378 return VK_O; //(4F) O key case 'o': case 'O': return 0x4F;379 380 return VK_P; //(50) P key case 'p': case 'P': return 0x50;381 382 return VK_Q; //(51) Q key case 'q': case 'Q': return 0x51;383 384 return VK_R; //(52) R key case 'r': case 'R': return 0x52;385 386 return VK_S; //(53) S key case 's': case 'S': return 0x53;387 388 return VK_T; //(54) T key case 't': case 'T': return 0x54;389 390 return VK_U; //(55) U key case 'u': case 'U': return 0x55;391 392 return VK_V; //(56) V key case 'v': case 'V': return 0x56;393 394 return VK_W; //(57) W key case 'w': case 'W': return 0x57;395 396 return VK_X; //(58) X key case 'x': case 'X': return 0x58;397 398 return VK_Y; //(59) Y key case 'y': case 'Y': return 0x59;399 400 return VK_Z; //(5A) Z key case 'z': case 'Z': return 0x5A;401 402 403 // case Qt::Key_Meta_R: FIXME: What to do here?198 case Qt::Key_Backspace: 199 return VK_BACK; // (08) BACKSPACE key 200 case Qt::Key_Backtab: 201 case Qt::Key_Tab: 202 return VK_TAB; // (09) TAB key 203 case Qt::Key_Clear: 204 return VK_CLEAR; // (0C) CLEAR key 205 case Qt::Key_Enter: 206 case Qt::Key_Return: 207 return VK_RETURN; // (0D) Return key 208 case Qt::Key_Shift: 209 return VK_SHIFT; // (10) SHIFT key 210 case Qt::Key_Control: 211 return VK_CONTROL; // (11) CTRL key 212 case Qt::Key_Menu: 213 case Qt::Key_Alt: 214 return VK_MENU; // (12) ALT key 215 216 case Qt::Key_F1: 217 return VK_F1; 218 case Qt::Key_F2: 219 return VK_F2; 220 case Qt::Key_F3: 221 return VK_F3; 222 case Qt::Key_F4: 223 return VK_F4; 224 case Qt::Key_F5: 225 return VK_F5; 226 case Qt::Key_F6: 227 return VK_F6; 228 case Qt::Key_F7: 229 return VK_F7; 230 case Qt::Key_F8: 231 return VK_F8; 232 case Qt::Key_F9: 233 return VK_F9; 234 case Qt::Key_F10: 235 return VK_F10; 236 case Qt::Key_F11: 237 return VK_F11; 238 case Qt::Key_F12: 239 return VK_F12; 240 case Qt::Key_F13: 241 return VK_F13; 242 case Qt::Key_F14: 243 return VK_F14; 244 case Qt::Key_F15: 245 return VK_F15; 246 case Qt::Key_F16: 247 return VK_F16; 248 case Qt::Key_F17: 249 return VK_F17; 250 case Qt::Key_F18: 251 return VK_F18; 252 case Qt::Key_F19: 253 return VK_F19; 254 case Qt::Key_F20: 255 return VK_F20; 256 case Qt::Key_F21: 257 return VK_F21; 258 case Qt::Key_F22: 259 return VK_F22; 260 case Qt::Key_F23: 261 return VK_F23; 262 case Qt::Key_F24: 263 return VK_F24; 264 265 case Qt::Key_Pause: 266 return VK_PAUSE; // (13) PAUSE key 267 case Qt::Key_CapsLock: 268 return VK_CAPITAL; // (14) CAPS LOCK key 269 case Qt::Key_Kana_Lock: 270 case Qt::Key_Kana_Shift: 271 return VK_KANA; // (15) Input Method Editor (IME) Kana mode 272 case Qt::Key_Hangul: 273 return VK_HANGUL; // VK_HANGUL (15) IME Hangul mode 274 // VK_JUNJA (17) IME Junja mode 275 // VK_FINAL (18) IME final mode 276 case Qt::Key_Hangul_Hanja: 277 return VK_HANJA; // (19) IME Hanja mode 278 case Qt::Key_Kanji: 279 return VK_KANJI; // (19) IME Kanji mode 280 case Qt::Key_Escape: 281 return VK_ESCAPE; // (1B) ESC key 282 // VK_CONVERT (1C) IME convert 283 // VK_NONCONVERT (1D) IME nonconvert 284 // VK_ACCEPT (1E) IME accept 285 // VK_MODECHANGE (1F) IME mode change request 286 case Qt::Key_Space: 287 return VK_SPACE; // (20) SPACEBAR 288 case Qt::Key_PageUp: 289 return VK_PRIOR; // (21) PAGE UP key 290 case Qt::Key_PageDown: 291 return VK_NEXT; // (22) PAGE DOWN key 292 case Qt::Key_End: 293 return VK_END; // (23) END key 294 case Qt::Key_Home: 295 return VK_HOME; // (24) HOME key 296 case Qt::Key_Left: 297 return VK_LEFT; // (25) LEFT ARROW key 298 case Qt::Key_Up: 299 return VK_UP; // (26) UP ARROW key 300 case Qt::Key_Right: 301 return VK_RIGHT; // (27) RIGHT ARROW key 302 case Qt::Key_Down: 303 return VK_DOWN; // (28) DOWN ARROW key 304 case Qt::Key_Select: 305 return VK_SELECT; // (29) SELECT key 306 case Qt::Key_Print: 307 return VK_PRINT; // (2A) PRINT key 308 case Qt::Key_Execute: 309 return VK_EXECUTE; // (2B) EXECUTE key 310 // dunno on this 311 // case Qt::Key_PrintScreen: 312 // return VK_SNAPSHOT; // (2C) PRINT SCREEN key 313 case Qt::Key_Insert: 314 return VK_INSERT; // (2D) INS key 315 case Qt::Key_Delete: 316 return VK_DELETE; // (2E) DEL key 317 case Qt::Key_Help: 318 return VK_HELP; // (2F) HELP key 319 case Qt::Key_0: 320 case Qt::Key_ParenLeft: 321 return VK_0; // (30) 0) key 322 case Qt::Key_1: 323 return VK_1; // (31) 1 ! key 324 case Qt::Key_2: 325 case Qt::Key_At: 326 return VK_2; // (32) 2 & key 327 case Qt::Key_3: 328 case Qt::Key_NumberSign: 329 return VK_3; // case '3': case '#'; 330 case Qt::Key_4: 331 case Qt::Key_Dollar: // (34) 4 key '$'; 332 return VK_4; 333 case Qt::Key_5: 334 case Qt::Key_Percent: 335 return VK_5; // (35) 5 key '%' 336 case Qt::Key_6: 337 case Qt::Key_AsciiCircum: 338 return VK_6; // (36) 6 key '^' 339 case Qt::Key_7: 340 case Qt::Key_Ampersand: 341 return VK_7; // (37) 7 key case '&' 342 case Qt::Key_8: 343 case Qt::Key_Asterisk: 344 return VK_8; // (38) 8 key '*' 345 case Qt::Key_9: 346 case Qt::Key_ParenRight: 347 return VK_9; // (39) 9 key '(' 348 case Qt::Key_A: 349 return VK_A; // (41) A key case 'a': case 'A': return 0x41; 350 case Qt::Key_B: 351 return VK_B; // (42) B key case 'b': case 'B': return 0x42; 352 case Qt::Key_C: 353 return VK_C; // (43) C key case 'c': case 'C': return 0x43; 354 case Qt::Key_D: 355 return VK_D; // (44) D key case 'd': case 'D': return 0x44; 356 case Qt::Key_E: 357 return VK_E; // (45) E key case 'e': case 'E': return 0x45; 358 case Qt::Key_F: 359 return VK_F; // (46) F key case 'f': case 'F': return 0x46; 360 case Qt::Key_G: 361 return VK_G; // (47) G key case 'g': case 'G': return 0x47; 362 case Qt::Key_H: 363 return VK_H; // (48) H key case 'h': case 'H': return 0x48; 364 case Qt::Key_I: 365 return VK_I; // (49) I key case 'i': case 'I': return 0x49; 366 case Qt::Key_J: 367 return VK_J; // (4A) J key case 'j': case 'J': return 0x4A; 368 case Qt::Key_K: 369 return VK_K; // (4B) K key case 'k': case 'K': return 0x4B; 370 case Qt::Key_L: 371 return VK_L; // (4C) L key case 'l': case 'L': return 0x4C; 372 case Qt::Key_M: 373 return VK_M; // (4D) M key case 'm': case 'M': return 0x4D; 374 case Qt::Key_N: 375 return VK_N; // (4E) N key case 'n': case 'N': return 0x4E; 376 case Qt::Key_O: 377 return VK_O; // (4F) O key case 'o': case 'O': return 0x4F; 378 case Qt::Key_P: 379 return VK_P; // (50) P key case 'p': case 'P': return 0x50; 380 case Qt::Key_Q: 381 return VK_Q; // (51) Q key case 'q': case 'Q': return 0x51; 382 case Qt::Key_R: 383 return VK_R; // (52) R key case 'r': case 'R': return 0x52; 384 case Qt::Key_S: 385 return VK_S; // (53) S key case 's': case 'S': return 0x53; 386 case Qt::Key_T: 387 return VK_T; // (54) T key case 't': case 'T': return 0x54; 388 case Qt::Key_U: 389 return VK_U; // (55) U key case 'u': case 'U': return 0x55; 390 case Qt::Key_V: 391 return VK_V; // (56) V key case 'v': case 'V': return 0x56; 392 case Qt::Key_W: 393 return VK_W; // (57) W key case 'w': case 'W': return 0x57; 394 case Qt::Key_X: 395 return VK_X; // (58) X key case 'x': case 'X': return 0x58; 396 case Qt::Key_Y: 397 return VK_Y; // (59) Y key case 'y': case 'Y': return 0x59; 398 case Qt::Key_Z: 399 return VK_Z; // (5A) Z key case 'z': case 'Z': return 0x5A; 400 case Qt::Key_Meta: 401 return VK_LWIN; // (5B) Left Windows key (Microsoft Natural keyboard) 402 // case Qt::Key_Meta_R: FIXME: What to do here? 404 403 // return VK_RWIN; // (5C) Right Windows key (Natural keyboard) 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 return VK_OEM_1; //case ';': case ':': return 0xBA;448 449 450 451 return VK_OEM_PLUS; //case '=': case '+': return 0xBB;452 453 454 455 return VK_OEM_COMMA; //case ',': case '<': return 0xBC;456 457 458 459 return VK_OEM_MINUS; //case '-': case '_': return 0xBD;460 461 462 463 return VK_OEM_PERIOD; //case '.': case '>': return 0xBE;464 465 466 467 return VK_OEM_2; //case '/': case '?': return 0xBF;468 469 470 471 return VK_OEM_3; //case '`': case '~': return 0xC0;472 473 474 475 return VK_OEM_4; //case '[': case '{': return 0xDB;476 477 478 479 return VK_OEM_5; //case '\\': case '|': return 0xDC;480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 404 // VK_APPS (5D) Applications key (Natural keyboard) 405 // VK_SLEEP (5F) Computer Sleep key 406 // VK_SEPARATOR (6C) Separator key 407 // VK_SUBTRACT (6D) Subtract key 408 // VK_DECIMAL (6E) Decimal key 409 // VK_DIVIDE (6F) Divide key 410 // handled by key code above 411 412 case Qt::Key_NumLock: 413 return VK_NUMLOCK; // (90) NUM LOCK key 414 415 case Qt::Key_ScrollLock: 416 return VK_SCROLL; // (91) SCROLL LOCK key 417 418 // VK_LSHIFT (A0) Left SHIFT key 419 // VK_RSHIFT (A1) Right SHIFT key 420 // VK_LCONTROL (A2) Left CONTROL key 421 // VK_RCONTROL (A3) Right CONTROL key 422 // VK_LMENU (A4) Left MENU key 423 // VK_RMENU (A5) Right MENU key 424 // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key 425 // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key 426 // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key 427 // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key 428 // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key 429 // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key 430 // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key 431 // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key 432 // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key 433 // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key 434 // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key 435 // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key 436 // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key 437 // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key 438 // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key 439 // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key 440 // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key 441 // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key 442 443 // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key 444 case Qt::Key_Semicolon: 445 case Qt::Key_Colon: 446 return VK_OEM_1; // case ';': case ':': return 0xBA; 447 // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key 448 case Qt::Key_Plus: 449 case Qt::Key_Equal: 450 return VK_OEM_PLUS; // case '=': case '+': return 0xBB; 451 // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key 452 case Qt::Key_Comma: 453 case Qt::Key_Less: 454 return VK_OEM_COMMA; // case ',': case '<': return 0xBC; 455 // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key 456 case Qt::Key_Minus: 457 case Qt::Key_Underscore: 458 return VK_OEM_MINUS; // case '-': case '_': return 0xBD; 459 // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key 460 case Qt::Key_Period: 461 case Qt::Key_Greater: 462 return VK_OEM_PERIOD; // case '.': case '>': return 0xBE; 463 // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key 464 case Qt::Key_Slash: 465 case Qt::Key_Question: 466 return VK_OEM_2; // case '/': case '?': return 0xBF; 467 // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key 468 case Qt::Key_AsciiTilde: 469 case Qt::Key_QuoteLeft: 470 return VK_OEM_3; // case '`': case '~': return 0xC0; 471 // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key 472 case Qt::Key_BracketLeft: 473 case Qt::Key_BraceLeft: 474 return VK_OEM_4; // case '[': case '{': return 0xDB; 475 // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key 476 case Qt::Key_Backslash: 477 case Qt::Key_Bar: 478 return VK_OEM_5; // case '\\': case '|': return 0xDC; 479 // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key 480 case Qt::Key_BracketRight: 481 case Qt::Key_BraceRight: 482 return VK_OEM_6; // case ']': case '}': return 0xDD; 483 // 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 484 case Qt::Key_QuoteDbl: 485 return VK_OEM_7; // case '\'': case '"': return 0xDE; 486 // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. 487 // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard 488 // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key 489 // 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 490 // VK_ATTN (F6) Attn key 491 // VK_CRSEL (F7) CrSel key 492 // VK_EXSEL (F8) ExSel key 493 // VK_EREOF (F9) Erase EOF key 494 // VK_PLAY (FA) Play key 495 // VK_ZOOM (FB) Zoom key 496 // VK_NONAME (FC) Reserved for future use 497 // VK_PA1 (FD) PA1 key 498 // VK_OEM_CLEAR (FE) Clear key 499 default: 500 return 0; 502 501 } 503 504 502 } 505 503 … … 512 510 m_keyIdentifier = keyIdentifierForQtKeyCode(event->key()); 513 511 m_autoRepeat = event->isAutoRepeat(); 514 m_ctrlKey = (state & Qt::ControlModifier) != 0;515 m_altKey = (state & Qt::AltModifier) != 0;516 m_metaKey = (state & Qt::MetaModifier) != 0;517 m_isKeypad = (state & Qt::KeypadModifier) != 0;512 m_ctrlKey = (state & Qt::ControlModifier); 513 m_altKey = (state & Qt::AltModifier); 514 m_metaKey = (state & Qt::MetaModifier); 515 m_isKeypad = (state & Qt::KeypadModifier); 518 516 m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(event->key(), m_isKeypad); 519 517 m_nativeVirtualKeyCode = event->nativeVirtualKey(); 520 m_shiftKey = (state & Qt::ShiftModifier) != 0|| event->key() == Qt::Key_Backtab; // Simulate Shift+Tab with Key_Backtab518 m_shiftKey = (state & Qt::ShiftModifier) || event->key() == Qt::Key_Backtab; // Simulate Shift+Tab with Key_Backtab 521 519 m_qtEvent = event; 522 520 }
Note: See TracChangeset
for help on using the changeset viewer.