| 389 | } |
| 390 | |
| 391 | void Interception_Worker::startInterception() |
| 392 | { |
| 393 | if (s_InterceptionContext == Q_NULLPTR) { |
| 394 | return; |
| 395 | } |
| 396 | |
| 397 | QKeyMapper_Worker::pressedMultiKeyboardVKeyCodeList.clear(); |
| 398 | for (int i = 0; i < INTERCEPTION_MAX_KEYBOARD; ++i) { |
| 399 | QKeyMapper_Worker::pressedMultiKeyboardVKeyCodeList.append(QList<quint8>()); |
| 400 | } |
| 401 | s_InterceptStart = true; |
| 402 | |
| 403 | #ifdef QT_DEBUG |
| 404 | if (!IsDebuggerPresent()) { |
| 405 | interception_set_filter(s_InterceptionContext, interception_is_keyboard, INTERCEPTION_FILTER_KEY_ALL); |
| 406 | interception_set_filter(s_InterceptionContext, interception_is_mouse, INTERCEPTION_FILTER_MOUSE_ALL); |
| 407 | } |
| 408 | #else |
| 409 | interception_set_filter(s_InterceptionContext, interception_is_keyboard, INTERCEPTION_FILTER_KEY_ALL); |
| 410 | interception_set_filter(s_InterceptionContext, interception_is_mouse, INTERCEPTION_FILTER_MOUSE_ALL); |
| 411 | #endif |
| 412 | #ifdef DEBUG_LOGOUT_ON |
| 413 | qDebug().nospace() << "[startInterception] Start Keyboard & Mouse Interception."; |
| 414 | #endif |
| 415 | } |
| 416 | |
| 417 | void Interception_Worker::stopInterception() |
| 418 | { |