Changeset View
Changeset View
Standalone View
Standalone View
globalaccel.cpp
Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Line(s) | 240 | if (sym >= XK_KP_Space && sym <= XK_KP_9) { | |||
---|---|---|---|---|---|
249 | 249 | | |||
250 | default: | 250 | default: | ||
251 | keyModX ^= KKeyServer::modXShift(); | 251 | keyModX ^= KKeyServer::modXShift(); | ||
252 | } | 252 | } | ||
253 | } | 253 | } | ||
254 | } | 254 | } | ||
255 | 255 | | |||
256 | int keyCodeQt; | 256 | int keyCodeQt; | ||
257 | int keyModQt; | 257 | KKeyServer::symXModXToKeyQt(keySymX, keyModX, &keyCodeQt); | ||
258 | KKeyServer::symXToKeyQt(keySymX, &keyCodeQt); | 258 | // Split keycode and modifier | ||
259 | KKeyServer::modXToQt(keyModX, &keyModQt); | 259 | int keyModQt = keyCodeQt & Qt::KeyboardModifierMask; | ||
260 | keyCodeQt &= ~Qt::KeyboardModifierMask; | ||||
260 | 261 | | |||
261 | if (keyModQt & Qt::SHIFT && !KKeyServer::isShiftAsModifierAllowed(keyCodeQt)) { | 262 | if (keyModQt & Qt::SHIFT && !KKeyServer::isShiftAsModifierAllowed(keyCodeQt)) { | ||
262 | keyModQt &= ~Qt::SHIFT; | 263 | keyModQt &= ~Qt::SHIFT; | ||
263 | } | 264 | } | ||
264 | 265 | | |||
265 | if ((keyModQt == 0 || keyModQt == Qt::SHIFT) && (keyCodeQt >= Qt::Key_Space && keyCodeQt <= Qt::Key_AsciiTilde)) { | 266 | if ((keyModQt == 0 || keyModQt == Qt::SHIFT) && (keyCodeQt >= Qt::Key_Space && keyCodeQt <= Qt::Key_AsciiTilde)) { | ||
266 | // security check: we don't allow shortcuts without modifier for "normal" keys | 267 | // security check: we don't allow shortcuts without modifier for "normal" keys | ||
267 | // this is to prevent a malicious application to grab shortcuts for all keys | 268 | // this is to prevent a malicious application to grab shortcuts for all keys | ||
Show All 18 Lines |