35 { Qt::Key_Cancel, VK_CANCEL },
36 { Qt::Key_Backspace, VK_BACK },
37 { Qt::Key_Tab, VK_TAB },
38 { Qt::Key_Clear, VK_CLEAR },
39 { Qt::Key_Return, VK_RETURN },
40 { Qt::Key_Shift, VK_SHIFT },
41 { Qt::Key_Control, VK_CONTROL },
42 { Qt::Key_Alt, VK_MENU },
43 { Qt::Key_Pause, VK_PAUSE },
44 { Qt::Key_CapsLock, VK_CAPITAL },
45 { Qt::Key_Escape, VK_ESCAPE },
48 { Qt::Key_Mode_switch, VK_MODECHANGE },
50 { Qt::Key_Space, VK_SPACE },
51 { Qt::Key_PageUp, VK_PRIOR },
52 { Qt::Key_PageDown, VK_NEXT },
53 { Qt::Key_End, VK_END },
54 { Qt::Key_Home, VK_HOME },
55 { Qt::Key_Left, VK_LEFT },
56 { Qt::Key_Up, VK_UP },
57 { Qt::Key_Right, VK_RIGHT },
58 { Qt::Key_Down, VK_DOWN },
59 { Qt::Key_Select, VK_SELECT },
60 { Qt::Key_Printer, VK_PRINT },
61 { Qt::Key_Execute, VK_EXECUTE },
62 { Qt::Key_Print, VK_SNAPSHOT },
63 { Qt::Key_Insert, VK_INSERT },
64 { Qt::Key_Delete, VK_DELETE },
65 { Qt::Key_Help, VK_HELP },
102 { Qt::Key_Meta, VK_LWIN },
103 { Qt::Key_Meta, VK_RWIN },
104 { Qt::Key_Menu, VK_APPS },
105 { Qt::Key_Sleep, VK_SLEEP },
106 { Qt::Key_0, VK_NUMPAD0 },
107 { Qt::Key_1, VK_NUMPAD1 },
108 { Qt::Key_2, VK_NUMPAD2 },
109 { Qt::Key_3, VK_NUMPAD3 },
110 { Qt::Key_4, VK_NUMPAD4 },
111 { Qt::Key_5, VK_NUMPAD5 },
112 { Qt::Key_6, VK_NUMPAD6 },
113 { Qt::Key_7, VK_NUMPAD7 },
114 { Qt::Key_8, VK_NUMPAD8 },
115 { Qt::Key_9, VK_NUMPAD9 },
116 { Qt::Key_Asterisk, VK_MULTIPLY },
117 { Qt::Key_Plus, VK_ADD },
118 { Qt::Key_Comma, VK_SEPARATOR },
119 { Qt::Key_Minus, VK_SUBTRACT },
120 { Qt::Key_Period, VK_DECIMAL },
121 { Qt::Key_Slash, VK_DIVIDE },
122 { Qt::Key_F1, VK_F1 },
123 { Qt::Key_F2, VK_F2 },
124 { Qt::Key_F3, VK_F3 },
125 { Qt::Key_F4, VK_F4 },
126 { Qt::Key_F5, VK_F5 },
127 { Qt::Key_F6, VK_F6 },
128 { Qt::Key_F7, VK_F7 },
129 { Qt::Key_F8, VK_F8 },
130 { Qt::Key_F9, VK_F9 },
131 { Qt::Key_F10, VK_F10 },
132 { Qt::Key_F11, VK_F11 },
133 { Qt::Key_F12, VK_F12 },
134 { Qt::Key_F13, VK_F13 },
135 { Qt::Key_F14, VK_F14 },
136 { Qt::Key_F15, VK_F15 },
137 { Qt::Key_F16, VK_F16 },
138 { Qt::Key_F17, VK_F17 },
139 { Qt::Key_F18, VK_F18 },
140 { Qt::Key_F19, VK_F19 },
141 { Qt::Key_F20, VK_F20 },
142 { Qt::Key_F21, VK_F21 },
143 { Qt::Key_F22, VK_F22 },
144 { Qt::Key_F23, VK_F23 },
145 { Qt::Key_F24, VK_F24 },
146 { Qt::Key_NumLock, VK_NUMLOCK },
147 { Qt::Key_ScrollLock, VK_SCROLL },
153 { Qt::Key_Shift, VK_LSHIFT },
154 { Qt::Key_Shift, VK_RSHIFT },
155 { Qt::Key_Control, VK_LCONTROL },
156 { Qt::Key_Control, VK_RCONTROL },
157 { Qt::Key_Alt, VK_LMENU },
158 { Qt::Key_Alt, VK_RMENU },
162 #if(_WIN32_WINNT >= 0x0500)
163 { Qt::Key_Back, VK_BROWSER_BACK },
164 { Qt::Key_Forward, VK_BROWSER_FORWARD },
165 { Qt::Key_Refresh, VK_BROWSER_REFRESH },
166 { Qt::Key_Stop, VK_BROWSER_STOP },
167 { Qt::Key_Search, VK_BROWSER_SEARCH },
168 { Qt::Key_Favorites, VK_BROWSER_FAVORITES },
169 { Qt::Key_HomePage, VK_BROWSER_HOME },
170 { Qt::Key_VolumeMute, VK_VOLUME_MUTE },
171 { Qt::Key_VolumeDown, VK_VOLUME_DOWN },
172 { Qt::Key_VolumeUp, VK_VOLUME_UP },
173 { Qt::Key_MediaNext, VK_MEDIA_NEXT_TRACK },
174 { Qt::Key_MediaPrevious, VK_MEDIA_PREV_TRACK },
175 { Qt::Key_MediaStop, VK_MEDIA_STOP },
176 { Qt::Key_MediaPlay, VK_MEDIA_PLAY_PAUSE },
177 { Qt::Key_LaunchMail, VK_LAUNCH_MAIL },
178 { Qt::Key_LaunchMedia, VK_LAUNCH_MEDIA_SELECT },
179 { Qt::Key_Launch0, VK_LAUNCH_APP1 },
180 { Qt::Key_Launch1, VK_LAUNCH_APP2 },
194 { Qt::Key_Play, VK_PLAY },
195 { Qt::Key_Zoom, VK_ZOOM },
196 { Qt::Key_Clear, VK_OEM_CLEAR },
203 if (keyQt & Qt::ShiftModifier) {
206 if (keyQt & Qt::ControlModifier) {
209 if (keyQt & Qt::AltModifier) {
212 if (keyQt & Qt::MetaModifier) {
222 if (mod & MOD_SHIFT) {
223 *keyQt |= Qt::ShiftModifier;
225 if (mod & MOD_CONTROL) {
226 *keyQt |= Qt::ControlModifier;
229 *keyQt |= Qt::AltModifier;
232 *keyQt |= Qt::MetaModifier;
240 int symQt = keyQt & ~Qt::KeyboardModifierMask;
242 if( symQt >= Qt::Key_A && symQt <= Qt::Key_Z ) {
247 for( uint i = 0; i <
sizeof(
KeyTbl); i++ ) {
248 if(
KeyTbl[i].keySymQt == symQt ) {
249 *sym =
KeyTbl[i].keySymWin;
255 if( symQt != Qt::Key_Shift && symQt != Qt::Key_Control && symQt != Qt::Key_Alt &&
256 symQt != Qt::Key_Meta && symQt != Qt::Key_Direction_L && symQt != Qt::Key_Direction_R )
263 if( sym >= Qt::Key_A && sym <= Qt::Key_Z ) {
268 for( uint i = 0; i <
sizeof(
KeyTbl); i++ ) {
269 if(
KeyTbl[i].keySymWin == sym ) {
270 *keyQt =
KeyTbl[i].keySymQt;
bool codeWinToKeyQt(uint sym, int *keyQt)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
QString number(int n, int base)
bool modWinToKeyQt(uint mod, int *keyQt)
bool keyQtToCodeWin(int keyQt, uint *sym)
Extracts the symbol from the given Qt key and converts it to a Windows symbol.
bool keyQtToModWin(int keyQt, uint *mod)
Extracts the modifiers from the given Qt key and converts them in a mask of Windows modifiers...
static const TransKey KeyTbl[]