| 16364 | } |
| 16365 | |
| 16366 | bool QKeyMapper_Worker::detectMappingStopKey(const QString &keycodeString, int keyupdown) |
| 16367 | { |
| 16368 | bool detected = false; |
| 16369 | bool passthrough = false; |
| 16370 | QString mappingswitchKey = QKeyMapper::s_MappingStopKeyString; |
| 16371 | if (mappingswitchKey.startsWith(PREFIX_PASSTHROUGH)) { |
| 16372 | passthrough = true; |
| 16373 | mappingswitchKey.remove(0, 1); |
| 16374 | } |
| 16375 | QStringList keys = mappingswitchKey.split(SEPARATOR_PLUS); |
| 16376 | bool allKeysPressed = true; |
| 16377 | bool combinationKey = (keys.size() > 1) ? true : false; |
| 16378 | QList<int> pressedCombinationRealKeysOrder; |
| 16379 | |
| 16380 | for (const QString &key : std::as_const(keys)) |
| 16381 | { |
| 16382 | int index = pressedRealKeysListRemoveMultiInput.indexOf(key); |
| 16383 | if (index < 0) |
| 16384 | { |
| 16385 | allKeysPressed = false; |
| 16386 | break; |
| 16387 | } |
| 16388 | else { |
| 16389 | pressedCombinationRealKeysOrder.append(index); |
| 16390 | } |
| 16391 | } |
| 16392 | |
| 16393 | if (combinationKey) { |
| 16394 | bool keyorder_increasing = isKeyOrderIncreasing(pressedCombinationRealKeysOrder); |
| 16395 | if (!keyorder_increasing) { |
| 16396 | allKeysPressed = false; |
| 16397 | } |
| 16398 | } |
| 16399 | |
| 16400 | if (KEY_DOWN == keyupdown && allKeysPressed && mappingswitchKey.contains(keycodeString)) |
| 16401 | { |
| 16402 | #ifdef DEBUG_LOGOUT_ON |
| 16403 | qDebug() << "[detectMappingSwitchKey]" << "MappingStopKey Activated ->" << mappingswitchKey; |
| 16404 | #endif |
| 16405 | emit QKeyMapper::getInstance()->HotKeyMappingStop_Signal(mappingswitchKey); |
| 16406 | if (passthrough) { |
| 16407 | detected = false; |
| 16408 | } |
| 16409 | else { |
| 16410 | detected = true; |
| 16411 | } |
| 16412 | } |
| 16413 | |
| 16414 | return detected; |
| 16415 | } |
| 16416 | |
| 16417 | bool QKeyMapper_Worker::detectMappingTableTabHotkeys(const QString &keycodeString, int keyupdown) |
| 16418 | { |