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.
This commit is contained in:
Martin Gräßlin 2015-08-31 08:55:26 +02:00
parent 902bdb6cf0
commit 66ad99787c
2 changed files with 8 additions and 0 deletions

View file

@ -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()) {

View file

@ -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);