diff options
author | Sebastien Braun | 2010-10-05 14:57:32 +0200 |
---|---|---|
committer | Sebastien Braun | 2010-10-05 18:15:49 +0200 |
commit | 6f5efe4759276bb5f4add3db93b14051700d2e0d (patch) | |
tree | e8fa85d7808add897ec2adf75ca680feb95fc5ff /src/input | |
parent | Fix Xkb handling on certain systems. (diff) | |
download | pvs-6f5efe4759276bb5f4add3db93b14051700d2e0d.tar.gz pvs-6f5efe4759276bb5f4add3db93b14051700d2e0d.tar.xz pvs-6f5efe4759276bb5f4add3db93b14051700d2e0d.zip |
Remove unnecessary Qt dependency from inputEvent.cpp
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/inputEvent.cpp | 15 | ||||
-rw-r--r-- | src/input/inputEvent.h | 7 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/input/inputEvent.cpp b/src/input/inputEvent.cpp index 04a84e7..9b69a3a 100644 --- a/src/input/inputEvent.cpp +++ b/src/input/inputEvent.cpp @@ -66,10 +66,10 @@ quint16 InputEvent::mouseButtonsFromQt(int b) return ret; } -InputEvent InputEvent::mousePressRelease(QMouseEvent const* evt) +InputEvent InputEvent::mousePressRelease(int qt_button, int qt_buttons) { - quint16 button = mouseButtonsFromQt(evt->button()); - quint16 buttons = mouseButtonsFromQt(evt->buttons()); + quint16 button = mouseButtonsFromQt(qt_button); + quint16 buttons = mouseButtonsFromQt(qt_buttons); quint16 code; if(buttons & button) @@ -85,14 +85,15 @@ InputEvent InputEvent::mousePressRelease(QMouseEvent const* evt) return InputEvent(ET_BUTTON, code, value); } -InputEvent InputEvent::keyboardPress(QKeyEvent const* evt) +InputEvent InputEvent::keyboardPress(int key, int mods) { - quint32 value = evt->key() | evt->modifiers(); + quint32 value = key | mods; return InputEvent(ET_KEY, EC_PRESS, value); } -InputEvent InputEvent::keyboardRelease(QKeyEvent const* evt) +InputEvent InputEvent::keyboardRelease(int key, int mods) { - quint32 value = evt->key() | evt->modifiers(); + quint32 value = key | mods; return InputEvent(ET_KEY, EC_RELEASE, value); } + diff --git a/src/input/inputEvent.h b/src/input/inputEvent.h index 917cc64..7a64bfc 100644 --- a/src/input/inputEvent.h +++ b/src/input/inputEvent.h @@ -62,9 +62,9 @@ public: static uint16_t mouseButtonsFromQt(int b); - static InputEvent mousePressRelease(QMouseEvent const* event); - static InputEvent keyboardPress(QKeyEvent const* event); - static InputEvent keyboardRelease(QKeyEvent const* event); + static InputEvent mousePressRelease(int button, int buttons); + static InputEvent keyboardPress(int key, int mods); + static InputEvent keyboardRelease(int key, int mods); static const uint16_t ET_KEY = 0; static const uint16_t ET_BUTTON = 1; @@ -76,6 +76,7 @@ public: static const uint16_t EC_REBOOT = 2; static const uint16_t EC_SYSRQ = 3; static const uint16_t EC_KILL_X = 4; + static const uint16_t EC_SAY_HELLO = 5; //< for debugging purposes typedef uint32_t event_key; |