From 66ad99787c688473b9ed1b46d92c92659d262587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 31 Aug 2015 08:55:26 +0200 Subject: [PATCH] Add signal InputRedirection::keyStateChanged Complements all other signals for internal usage that there is an input event. Needed by e.g. DPMS implementation to re-enable the outputs. --- input.cpp | 1 + input.h | 7 +++++++ 2 files changed, 8 insertions(+) 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);