diff --git a/input.cpp b/input.cpp index 2e02662615..85d070b2e9 100644 --- a/input.cpp +++ b/input.cpp @@ -855,6 +855,7 @@ void InputRedirection::updateKeyboardWindow() void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time) { + emit keyStateChanged(key, state); const Qt::KeyboardModifiers oldMods = keyboardModifiers(); m_xkb->updateKey(key, state); if (oldMods != keyboardModifiers()) { diff --git a/input.h b/input.h index 72b6d1b0e2..0ec266ba53 100644 --- a/input.h +++ b/input.h @@ -182,6 +182,13 @@ Q_SIGNALS: * @param oldMods The previous modifiers state */ void keyboardModifiersChanged(Qt::KeyboardModifiers newMods, Qt::KeyboardModifiers oldMods); + /** + * @brief Emitted when the state of a key changed. + * + * @param keyCode The keycode of the key which changed + * @param oldMods The new key state + */ + void keyStateChanged(quint32 keyCode, InputRedirection::KeyboardKeyState state); private: static QEvent::Type buttonStateToEvent(PointerButtonState state);