| 68 | } |
| 69 | |
| 70 | quint32 QHotkeyPrivateWin::nativeKeycode(Qt::Key keycode, bool &ok) |
| 71 | { |
| 72 | ok = true; |
| 73 | if(keycode <= 0xFFFF) {//Try to obtain the key from it's "character" |
| 74 | const SHORT vKey = VkKeyScanW(static_cast<WCHAR>(keycode)); |
| 75 | if(vKey > -1) |
| 76 | return LOBYTE(vKey); |
| 77 | } |
| 78 | |
| 79 | //find key from switch/case --> Only finds a very small subset of keys |
| 80 | switch (keycode) |
| 81 | { |
| 82 | case Qt::Key_Escape: |
| 83 | return VK_ESCAPE; |
| 84 | case Qt::Key_Tab: |
| 85 | case Qt::Key_Backtab: |
| 86 | return VK_TAB; |
| 87 | case Qt::Key_Backspace: |
| 88 | return VK_BACK; |
| 89 | case Qt::Key_Return: |
| 90 | case Qt::Key_Enter: |
| 91 | return VK_RETURN; |
| 92 | case Qt::Key_Insert: |
| 93 | return VK_INSERT; |
| 94 | case Qt::Key_Delete: |
| 95 | return VK_DELETE; |
| 96 | case Qt::Key_Pause: |
| 97 | return VK_PAUSE; |
| 98 | case Qt::Key_Print: |
| 99 | return VK_PRINT; |
| 100 | case Qt::Key_Clear: |
| 101 | return VK_CLEAR; |
| 102 | case Qt::Key_Home: |
| 103 | return VK_HOME; |
| 104 | case Qt::Key_End: |
| 105 | return VK_END; |
| 106 | case Qt::Key_Left: |
| 107 | return VK_LEFT; |
| 108 | case Qt::Key_Up: |
| 109 | return VK_UP; |
| 110 | case Qt::Key_Right: |
| 111 | return VK_RIGHT; |
| 112 | case Qt::Key_Down: |
| 113 | return VK_DOWN; |
| 114 | case Qt::Key_PageUp: |
| 115 | return VK_PRIOR; |
| 116 | case Qt::Key_PageDown: |
| 117 | return VK_NEXT; |
| 118 | case Qt::Key_CapsLock: |
| 119 | return VK_CAPITAL; |
| 120 | case Qt::Key_NumLock: |
| 121 | return VK_NUMLOCK; |
| 122 | case Qt::Key_ScrollLock: |
| 123 | return VK_SCROLL; |
| 124 | |
| 125 | case Qt::Key_F1: |
| 126 | return VK_F1; |
| 127 | case Qt::Key_F2: |
nothing calls this directly
no outgoing calls
no test coverage detected