widget/qt/nsQtKeyUtils.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #include <qnamespace.h>
michael@0 8 #include "mozilla/ArrayUtils.h"
michael@0 9 #include "mozilla/TextEvents.h"
michael@0 10
michael@0 11 #include "nsWindow.h"
michael@0 12 #include "nsQtKeyUtils.h"
michael@0 13
michael@0 14 using namespace mozilla;
michael@0 15 using namespace mozilla::widget;
michael@0 16
michael@0 17 struct nsKeyConverter
michael@0 18 {
michael@0 19 int vkCode; // Platform independent key code
michael@0 20 int keysym; // Qt key code
michael@0 21 };
michael@0 22
michael@0 23 static struct nsKeyConverter nsKeycodes[] =
michael@0 24 {
michael@0 25 // { NS_VK_CANCEL, Qt::Key_Cancel },
michael@0 26 { NS_VK_BACK, Qt::Key_Backspace },
michael@0 27 { NS_VK_TAB, Qt::Key_Tab },
michael@0 28 { NS_VK_TAB, Qt::Key_Backtab },
michael@0 29 // { NS_VK_CLEAR, Qt::Key_Clear },
michael@0 30 { NS_VK_RETURN, Qt::Key_Return },
michael@0 31 { NS_VK_RETURN, Qt::Key_Enter },
michael@0 32 { NS_VK_SHIFT, Qt::Key_Shift },
michael@0 33 { NS_VK_CONTROL, Qt::Key_Control },
michael@0 34 { NS_VK_ALT, Qt::Key_Alt },
michael@0 35 { NS_VK_PAUSE, Qt::Key_Pause },
michael@0 36 { NS_VK_CAPS_LOCK, Qt::Key_CapsLock },
michael@0 37 { NS_VK_ESCAPE, Qt::Key_Escape },
michael@0 38 { NS_VK_SPACE, Qt::Key_Space },
michael@0 39 { NS_VK_PAGE_UP, Qt::Key_PageUp },
michael@0 40 { NS_VK_PAGE_DOWN, Qt::Key_PageDown },
michael@0 41 { NS_VK_END, Qt::Key_End },
michael@0 42 { NS_VK_HOME, Qt::Key_Home },
michael@0 43 { NS_VK_LEFT, Qt::Key_Left },
michael@0 44 { NS_VK_UP, Qt::Key_Up },
michael@0 45 { NS_VK_RIGHT, Qt::Key_Right },
michael@0 46 { NS_VK_DOWN, Qt::Key_Down },
michael@0 47 { NS_VK_PRINTSCREEN, Qt::Key_Print },
michael@0 48 { NS_VK_INSERT, Qt::Key_Insert },
michael@0 49 { NS_VK_DELETE, Qt::Key_Delete },
michael@0 50 { NS_VK_HELP, Qt::Key_Help },
michael@0 51
michael@0 52 { NS_VK_0, Qt::Key_0 },
michael@0 53 { NS_VK_1, Qt::Key_1 },
michael@0 54 { NS_VK_2, Qt::Key_2 },
michael@0 55 { NS_VK_3, Qt::Key_3 },
michael@0 56 { NS_VK_4, Qt::Key_4 },
michael@0 57 { NS_VK_5, Qt::Key_5 },
michael@0 58 { NS_VK_6, Qt::Key_6 },
michael@0 59 { NS_VK_7, Qt::Key_7 },
michael@0 60 { NS_VK_8, Qt::Key_8 },
michael@0 61 { NS_VK_9, Qt::Key_9 },
michael@0 62
michael@0 63 { NS_VK_SEMICOLON, Qt::Key_Semicolon },
michael@0 64 { NS_VK_EQUALS, Qt::Key_Equal },
michael@0 65
michael@0 66 { NS_VK_A, Qt::Key_A },
michael@0 67 { NS_VK_B, Qt::Key_B },
michael@0 68 { NS_VK_C, Qt::Key_C },
michael@0 69 { NS_VK_D, Qt::Key_D },
michael@0 70 { NS_VK_E, Qt::Key_E },
michael@0 71 { NS_VK_F, Qt::Key_F },
michael@0 72 { NS_VK_G, Qt::Key_G },
michael@0 73 { NS_VK_H, Qt::Key_H },
michael@0 74 { NS_VK_I, Qt::Key_I },
michael@0 75 { NS_VK_J, Qt::Key_J },
michael@0 76 { NS_VK_K, Qt::Key_K },
michael@0 77 { NS_VK_L, Qt::Key_L },
michael@0 78 { NS_VK_M, Qt::Key_M },
michael@0 79 { NS_VK_N, Qt::Key_N },
michael@0 80 { NS_VK_O, Qt::Key_O },
michael@0 81 { NS_VK_P, Qt::Key_P },
michael@0 82 { NS_VK_Q, Qt::Key_Q },
michael@0 83 { NS_VK_R, Qt::Key_R },
michael@0 84 { NS_VK_S, Qt::Key_S },
michael@0 85 { NS_VK_T, Qt::Key_T },
michael@0 86 { NS_VK_U, Qt::Key_U },
michael@0 87 { NS_VK_V, Qt::Key_V },
michael@0 88 { NS_VK_W, Qt::Key_W },
michael@0 89 { NS_VK_X, Qt::Key_X },
michael@0 90 { NS_VK_Y, Qt::Key_Y },
michael@0 91 { NS_VK_Z, Qt::Key_Z },
michael@0 92
michael@0 93 { NS_VK_NUMPAD0, Qt::Key_0 },
michael@0 94 { NS_VK_NUMPAD1, Qt::Key_1 },
michael@0 95 { NS_VK_NUMPAD2, Qt::Key_2 },
michael@0 96 { NS_VK_NUMPAD3, Qt::Key_3 },
michael@0 97 { NS_VK_NUMPAD4, Qt::Key_4 },
michael@0 98 { NS_VK_NUMPAD5, Qt::Key_5 },
michael@0 99 { NS_VK_NUMPAD6, Qt::Key_6 },
michael@0 100 { NS_VK_NUMPAD7, Qt::Key_7 },
michael@0 101 { NS_VK_NUMPAD8, Qt::Key_8 },
michael@0 102 { NS_VK_NUMPAD9, Qt::Key_9 },
michael@0 103 { NS_VK_MULTIPLY, Qt::Key_Asterisk },
michael@0 104 { NS_VK_ADD, Qt::Key_Plus },
michael@0 105 // { NS_VK_SEPARATOR, Qt::Key_Separator },
michael@0 106 { NS_VK_SUBTRACT, Qt::Key_Minus },
michael@0 107 { NS_VK_DECIMAL, Qt::Key_Period },
michael@0 108 { NS_VK_DIVIDE, Qt::Key_Slash },
michael@0 109 { NS_VK_F1, Qt::Key_F1 },
michael@0 110 { NS_VK_F2, Qt::Key_F2 },
michael@0 111 { NS_VK_F3, Qt::Key_F3 },
michael@0 112 { NS_VK_F4, Qt::Key_F4 },
michael@0 113 { NS_VK_F5, Qt::Key_F5 },
michael@0 114 { NS_VK_F6, Qt::Key_F6 },
michael@0 115 { NS_VK_F7, Qt::Key_F7 },
michael@0 116 { NS_VK_F8, Qt::Key_F8 },
michael@0 117 { NS_VK_F9, Qt::Key_F9 },
michael@0 118 { NS_VK_F10, Qt::Key_F10 },
michael@0 119 { NS_VK_F11, Qt::Key_F11 },
michael@0 120 { NS_VK_F12, Qt::Key_F12 },
michael@0 121 { NS_VK_F13, Qt::Key_F13 },
michael@0 122 { NS_VK_F14, Qt::Key_F14 },
michael@0 123 { NS_VK_F15, Qt::Key_F15 },
michael@0 124 { NS_VK_F16, Qt::Key_F16 },
michael@0 125 { NS_VK_F17, Qt::Key_F17 },
michael@0 126 { NS_VK_F18, Qt::Key_F18 },
michael@0 127 { NS_VK_F19, Qt::Key_F19 },
michael@0 128 { NS_VK_F20, Qt::Key_F20 },
michael@0 129 { NS_VK_F21, Qt::Key_F21 },
michael@0 130 { NS_VK_F22, Qt::Key_F22 },
michael@0 131 { NS_VK_F23, Qt::Key_F23 },
michael@0 132 { NS_VK_F24, Qt::Key_F24 },
michael@0 133
michael@0 134 { NS_VK_NUM_LOCK, Qt::Key_NumLock },
michael@0 135 { NS_VK_SCROLL_LOCK, Qt::Key_ScrollLock },
michael@0 136
michael@0 137 { NS_VK_COMMA, Qt::Key_Comma },
michael@0 138 { NS_VK_PERIOD, Qt::Key_Period },
michael@0 139 { NS_VK_SLASH, Qt::Key_Slash },
michael@0 140 { NS_VK_BACK_QUOTE, Qt::Key_QuoteLeft },
michael@0 141 { NS_VK_OPEN_BRACKET, Qt::Key_ParenLeft },
michael@0 142 { NS_VK_CLOSE_BRACKET, Qt::Key_ParenRight },
michael@0 143 { NS_VK_QUOTE, Qt::Key_QuoteDbl },
michael@0 144
michael@0 145 { NS_VK_META, Qt::Key_Meta }
michael@0 146 };
michael@0 147
michael@0 148 int
michael@0 149 QtKeyCodeToDOMKeyCode(int aKeysym)
michael@0 150 {
michael@0 151 unsigned int i;
michael@0 152
michael@0 153 // First, try to handle alphanumeric input, not listed in nsKeycodes:
michael@0 154 // most likely, more letters will be getting typed in than things in
michael@0 155 // the key list, so we will look through these first.
michael@0 156
michael@0 157 // since X has different key symbols for upper and lowercase letters and
michael@0 158 // mozilla does not, convert gdk's to mozilla's
michael@0 159 if (aKeysym >= Qt::Key_A && aKeysym <= Qt::Key_Z)
michael@0 160 return aKeysym - Qt::Key_A + NS_VK_A;
michael@0 161
michael@0 162 // numbers
michael@0 163 if (aKeysym >= Qt::Key_0 && aKeysym <= Qt::Key_9)
michael@0 164 return aKeysym - Qt::Key_0 + NS_VK_0;
michael@0 165
michael@0 166 // keypad numbers
michael@0 167 // if (aKeysym >= Qt::Key_KP_0 && aKeysym <= Qt::Key_KP_9)
michael@0 168 // return aKeysym - Qt::Key_KP_0 + NS_VK_NUMPAD0;
michael@0 169
michael@0 170 // misc other things
michael@0 171 for (i = 0; i < ArrayLength(nsKeycodes); i++) {
michael@0 172 if (nsKeycodes[i].keysym == aKeysym)
michael@0 173 return(nsKeycodes[i].vkCode);
michael@0 174 }
michael@0 175
michael@0 176 // function keys
michael@0 177 if (aKeysym >= Qt::Key_F1 && aKeysym <= Qt::Key_F24)
michael@0 178 return aKeysym - Qt::Key_F1 + NS_VK_F1;
michael@0 179
michael@0 180 return((int)0);
michael@0 181 }
michael@0 182
michael@0 183 int
michael@0 184 DOMKeyCodeToQtKeyCode(int aKeysym)
michael@0 185 {
michael@0 186 unsigned int i;
michael@0 187
michael@0 188 // First, try to handle alphanumeric input, not listed in nsKeycodes:
michael@0 189 // most likely, more letters will be getting typed in than things in
michael@0 190 // the key list, so we will look through these first.
michael@0 191
michael@0 192 if (aKeysym >= NS_VK_A && aKeysym <= NS_VK_Z)
michael@0 193 // gdk and DOM both use the ASCII codes for these keys.
michael@0 194 return aKeysym;
michael@0 195
michael@0 196 // numbers
michael@0 197 if (aKeysym >= NS_VK_0 && aKeysym <= NS_VK_9)
michael@0 198 // gdk and DOM both use the ASCII codes for these keys.
michael@0 199 return aKeysym - Qt::Key_0 + NS_VK_0;
michael@0 200
michael@0 201 // keypad numbers
michael@0 202 if (aKeysym >= NS_VK_NUMPAD0 && aKeysym <= NS_VK_NUMPAD9) {
michael@0 203 NS_ERROR("keypad numbers conversion not implemented");
michael@0 204 //return aKeysym - NS_VK_NUMPAD0 + Qt::Key_KP_0;
michael@0 205 return 0;
michael@0 206 }
michael@0 207
michael@0 208 // misc other things
michael@0 209 for (i = 0; i < ArrayLength(nsKeycodes); ++i) {
michael@0 210 if (nsKeycodes[i].vkCode == aKeysym) {
michael@0 211 return nsKeycodes[i].keysym;
michael@0 212 }
michael@0 213 }
michael@0 214
michael@0 215 // function keys
michael@0 216 if (aKeysym >= NS_VK_F1 && aKeysym <= NS_VK_F9)
michael@0 217 return aKeysym - NS_VK_F1 + Qt::Key_F1;
michael@0 218
michael@0 219 return 0;
michael@0 220 }
michael@0 221
michael@0 222 KeyNameIndex
michael@0 223 QtKeyCodeToDOMKeyNameIndex(int aKeysym)
michael@0 224 {
michael@0 225 switch (aKeysym) {
michael@0 226
michael@0 227 #define NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, aKeyNameIndex) \
michael@0 228 case aNativeKey: return aKeyNameIndex;
michael@0 229
michael@0 230 #include "NativeKeyToDOMKeyName.h"
michael@0 231
michael@0 232 #undef NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX
michael@0 233
michael@0 234 case Qt::Key_Exclam:
michael@0 235 case Qt::Key_QuoteDbl:
michael@0 236 case Qt::Key_NumberSign:
michael@0 237 case Qt::Key_Dollar:
michael@0 238 case Qt::Key_Percent:
michael@0 239 case Qt::Key_Ampersand:
michael@0 240 case Qt::Key_Apostrophe:
michael@0 241 case Qt::Key_ParenLeft:
michael@0 242 case Qt::Key_ParenRight:
michael@0 243 case Qt::Key_Asterisk:
michael@0 244 case Qt::Key_Plus:
michael@0 245 case Qt::Key_Comma:
michael@0 246 case Qt::Key_Minus:
michael@0 247 case Qt::Key_Period:
michael@0 248 case Qt::Key_Slash:
michael@0 249 case Qt::Key_0:
michael@0 250 case Qt::Key_1:
michael@0 251 case Qt::Key_2:
michael@0 252 case Qt::Key_3:
michael@0 253 case Qt::Key_4:
michael@0 254 case Qt::Key_5:
michael@0 255 case Qt::Key_6:
michael@0 256 case Qt::Key_7:
michael@0 257 case Qt::Key_8:
michael@0 258 case Qt::Key_9:
michael@0 259 case Qt::Key_Colon:
michael@0 260 case Qt::Key_Semicolon:
michael@0 261 case Qt::Key_Less:
michael@0 262 case Qt::Key_Equal:
michael@0 263 case Qt::Key_Greater:
michael@0 264 case Qt::Key_Question:
michael@0 265 case Qt::Key_At:
michael@0 266 case Qt::Key_A:
michael@0 267 case Qt::Key_B:
michael@0 268 case Qt::Key_C:
michael@0 269 case Qt::Key_D:
michael@0 270 case Qt::Key_E:
michael@0 271 case Qt::Key_F:
michael@0 272 case Qt::Key_G:
michael@0 273 case Qt::Key_H:
michael@0 274 case Qt::Key_I:
michael@0 275 case Qt::Key_J:
michael@0 276 case Qt::Key_K:
michael@0 277 case Qt::Key_L:
michael@0 278 case Qt::Key_M:
michael@0 279 case Qt::Key_N:
michael@0 280 case Qt::Key_O:
michael@0 281 case Qt::Key_P:
michael@0 282 case Qt::Key_Q:
michael@0 283 case Qt::Key_R:
michael@0 284 case Qt::Key_S:
michael@0 285 case Qt::Key_T:
michael@0 286 case Qt::Key_U:
michael@0 287 case Qt::Key_V:
michael@0 288 case Qt::Key_W:
michael@0 289 case Qt::Key_X:
michael@0 290 case Qt::Key_Y:
michael@0 291 case Qt::Key_Z:
michael@0 292 case Qt::Key_BracketLeft:
michael@0 293 case Qt::Key_Backslash:
michael@0 294 case Qt::Key_BracketRight:
michael@0 295 case Qt::Key_AsciiCircum:
michael@0 296 case Qt::Key_Underscore:
michael@0 297 case Qt::Key_QuoteLeft:
michael@0 298 case Qt::Key_BraceLeft:
michael@0 299 case Qt::Key_Bar:
michael@0 300 case Qt::Key_BraceRight:
michael@0 301 case Qt::Key_AsciiTilde:
michael@0 302 case Qt::Key_exclamdown:
michael@0 303 case Qt::Key_cent:
michael@0 304 case Qt::Key_sterling:
michael@0 305 case Qt::Key_currency:
michael@0 306 case Qt::Key_yen:
michael@0 307 case Qt::Key_brokenbar:
michael@0 308 case Qt::Key_section:
michael@0 309 case Qt::Key_diaeresis:
michael@0 310 case Qt::Key_copyright:
michael@0 311 case Qt::Key_ordfeminine:
michael@0 312 case Qt::Key_guillemotleft:
michael@0 313 case Qt::Key_notsign:
michael@0 314 case Qt::Key_hyphen:
michael@0 315 case Qt::Key_registered:
michael@0 316 case Qt::Key_macron:
michael@0 317 case Qt::Key_degree:
michael@0 318 case Qt::Key_plusminus:
michael@0 319 case Qt::Key_twosuperior:
michael@0 320 case Qt::Key_threesuperior:
michael@0 321 case Qt::Key_acute:
michael@0 322 case Qt::Key_mu:
michael@0 323 case Qt::Key_paragraph:
michael@0 324 case Qt::Key_periodcentered:
michael@0 325 case Qt::Key_cedilla:
michael@0 326 case Qt::Key_onesuperior:
michael@0 327 case Qt::Key_masculine:
michael@0 328 case Qt::Key_guillemotright:
michael@0 329 case Qt::Key_onequarter:
michael@0 330 case Qt::Key_onehalf:
michael@0 331 case Qt::Key_threequarters:
michael@0 332 case Qt::Key_questiondown:
michael@0 333 case Qt::Key_Agrave:
michael@0 334 case Qt::Key_Aacute:
michael@0 335 case Qt::Key_Acircumflex:
michael@0 336 case Qt::Key_Atilde:
michael@0 337 case Qt::Key_Adiaeresis:
michael@0 338 case Qt::Key_Aring:
michael@0 339 case Qt::Key_AE:
michael@0 340 case Qt::Key_Ccedilla:
michael@0 341 case Qt::Key_Egrave:
michael@0 342 case Qt::Key_Eacute:
michael@0 343 case Qt::Key_Ecircumflex:
michael@0 344 case Qt::Key_Ediaeresis:
michael@0 345 case Qt::Key_Igrave:
michael@0 346 case Qt::Key_Iacute:
michael@0 347 case Qt::Key_Icircumflex:
michael@0 348 case Qt::Key_Idiaeresis:
michael@0 349 case Qt::Key_ETH:
michael@0 350 case Qt::Key_Ntilde:
michael@0 351 case Qt::Key_Ograve:
michael@0 352 case Qt::Key_Oacute:
michael@0 353 case Qt::Key_Ocircumflex:
michael@0 354 case Qt::Key_Otilde:
michael@0 355 case Qt::Key_Odiaeresis:
michael@0 356 case Qt::Key_multiply:
michael@0 357 case Qt::Key_Ooblique:
michael@0 358 case Qt::Key_Ugrave:
michael@0 359 case Qt::Key_Uacute:
michael@0 360 case Qt::Key_Ucircumflex:
michael@0 361 case Qt::Key_Udiaeresis:
michael@0 362 case Qt::Key_Yacute:
michael@0 363 case Qt::Key_THORN:
michael@0 364 case Qt::Key_ssharp:
michael@0 365 case Qt::Key_division:
michael@0 366 case Qt::Key_ydiaeresis:
michael@0 367 return KEY_NAME_INDEX_PrintableKey;
michael@0 368
michael@0 369 case Qt::Key_Backtab:
michael@0 370 case Qt::Key_Direction_L:
michael@0 371 case Qt::Key_Direction_R:
michael@0 372 case Qt::Key_SingleCandidate:
michael@0 373 case Qt::Key_Hiragana_Katakana:
michael@0 374 case Qt::Key_Zenkaku_Hankaku:
michael@0 375 case Qt::Key_Touroku:
michael@0 376 case Qt::Key_Massyo:
michael@0 377 case Qt::Key_Hangul:
michael@0 378 case Qt::Key_Hangul_Start:
michael@0 379 case Qt::Key_Hangul_End:
michael@0 380 case Qt::Key_Hangul_Hanja:
michael@0 381 case Qt::Key_Hangul_Jamo:
michael@0 382 case Qt::Key_Hangul_Romaja:
michael@0 383 case Qt::Key_Hangul_Jeonja:
michael@0 384 case Qt::Key_Hangul_Banja:
michael@0 385 case Qt::Key_Hangul_PreHanja:
michael@0 386 case Qt::Key_Hangul_PostHanja:
michael@0 387 case Qt::Key_Hangul_Special:
michael@0 388 case Qt::Key_Dead_Belowdot:
michael@0 389 case Qt::Key_Dead_Hook:
michael@0 390 case Qt::Key_Dead_Horn:
michael@0 391 case Qt::Key_TrebleUp:
michael@0 392 case Qt::Key_TrebleDown:
michael@0 393 case Qt::Key_Standby:
michael@0 394 case Qt::Key_OpenUrl:
michael@0 395 case Qt::Key_LaunchMedia:
michael@0 396 case Qt::Key_KeyboardLightOnOff:
michael@0 397 case Qt::Key_KeyboardBrightnessUp:
michael@0 398 case Qt::Key_KeyboardBrightnessDown:
michael@0 399 case Qt::Key_WakeUp:
michael@0 400 case Qt::Key_ScreenSaver:
michael@0 401 case Qt::Key_WWW:
michael@0 402 case Qt::Key_Memo:
michael@0 403 case Qt::Key_LightBulb:
michael@0 404 case Qt::Key_Shop:
michael@0 405 case Qt::Key_History:
michael@0 406 case Qt::Key_AddFavorite:
michael@0 407 case Qt::Key_HotLinks:
michael@0 408 case Qt::Key_Finance:
michael@0 409 case Qt::Key_Community:
michael@0 410 case Qt::Key_BackForward:
michael@0 411 case Qt::Key_ApplicationLeft:
michael@0 412 case Qt::Key_ApplicationRight:
michael@0 413 case Qt::Key_Book:
michael@0 414 case Qt::Key_CD:
michael@0 415 case Qt::Key_Calculator:
michael@0 416 case Qt::Key_ToDoList:
michael@0 417 case Qt::Key_ClearGrab:
michael@0 418 case Qt::Key_Close:
michael@0 419 case Qt::Key_Display:
michael@0 420 case Qt::Key_DOS:
michael@0 421 case Qt::Key_Documents:
michael@0 422 case Qt::Key_Excel:
michael@0 423 case Qt::Key_Explorer:
michael@0 424 case Qt::Key_Game:
michael@0 425 case Qt::Key_Go:
michael@0 426 case Qt::Key_iTouch:
michael@0 427 case Qt::Key_LogOff:
michael@0 428 case Qt::Key_Market:
michael@0 429 case Qt::Key_Meeting:
michael@0 430 case Qt::Key_MenuKB:
michael@0 431 case Qt::Key_MenuPB:
michael@0 432 case Qt::Key_MySites:
michael@0 433 case Qt::Key_News:
michael@0 434 case Qt::Key_OfficeHome:
michael@0 435 case Qt::Key_Option:
michael@0 436 case Qt::Key_Phone:
michael@0 437 case Qt::Key_Calendar:
michael@0 438 case Qt::Key_Reply:
michael@0 439 case Qt::Key_RotateWindows:
michael@0 440 case Qt::Key_RotationPB:
michael@0 441 case Qt::Key_RotationKB:
michael@0 442 case Qt::Key_Save:
michael@0 443 case Qt::Key_Send:
michael@0 444 case Qt::Key_Spell:
michael@0 445 case Qt::Key_SplitScreen:
michael@0 446 case Qt::Key_Support:
michael@0 447 case Qt::Key_TaskPane:
michael@0 448 case Qt::Key_Terminal:
michael@0 449 case Qt::Key_Tools:
michael@0 450 case Qt::Key_Travel:
michael@0 451 case Qt::Key_Video:
michael@0 452 case Qt::Key_Word:
michael@0 453 case Qt::Key_Xfer:
michael@0 454 case Qt::Key_ZoomIn:
michael@0 455 case Qt::Key_ZoomOut:
michael@0 456 case Qt::Key_Away:
michael@0 457 case Qt::Key_Messenger:
michael@0 458 case Qt::Key_WebCam:
michael@0 459 case Qt::Key_MailForward:
michael@0 460 case Qt::Key_Pictures:
michael@0 461 case Qt::Key_Music:
michael@0 462 case Qt::Key_Battery:
michael@0 463 case Qt::Key_Bluetooth:
michael@0 464 case Qt::Key_WLAN:
michael@0 465 case Qt::Key_UWB:
michael@0 466 case Qt::Key_AudioRepeat:
michael@0 467 case Qt::Key_AudioCycleTrack:
michael@0 468 case Qt::Key_Time:
michael@0 469 case Qt::Key_Hibernate:
michael@0 470 case Qt::Key_View:
michael@0 471 case Qt::Key_TopMenu:
michael@0 472 case Qt::Key_PowerDown:
michael@0 473 case Qt::Key_Suspend:
michael@0 474 case Qt::Key_ContrastAdjust:
michael@0 475 case Qt::Key_TouchpadToggle:
michael@0 476 case Qt::Key_TouchpadOn:
michael@0 477 case Qt::Key_TouchpadOff:
michael@0 478 case Qt::Key_unknown:
michael@0 479 case Qt::Key_Call:
michael@0 480 case Qt::Key_CameraFocus:
michael@0 481 case Qt::Key_Context1:
michael@0 482 case Qt::Key_Context2:
michael@0 483 case Qt::Key_Context3:
michael@0 484 case Qt::Key_Context4:
michael@0 485 case Qt::Key_Flip:
michael@0 486 case Qt::Key_Hangup:
michael@0 487 case Qt::Key_No:
michael@0 488 case Qt::Key_Select:
michael@0 489 case Qt::Key_Yes:
michael@0 490 case Qt::Key_ToggleCallHangup:
michael@0 491 case Qt::Key_VoiceDial:
michael@0 492 case Qt::Key_LastNumberRedial:
michael@0 493 case Qt::Key_Printer:
michael@0 494 case Qt::Key_Sleep:
michael@0 495 default:
michael@0 496 return KEY_NAME_INDEX_Unidentified;
michael@0 497 }
michael@0 498 }
michael@0 499

mercurial