summaryrefslogtreecommitdiffhomepage
path: root/opentrack/keybinding-worker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack/keybinding-worker.cpp')
-rwxr-xr-x[-rw-r--r--]opentrack/keybinding-worker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/opentrack/keybinding-worker.cpp b/opentrack/keybinding-worker.cpp
index 39693a7c..2d133c2f 100644..100755
--- a/opentrack/keybinding-worker.cpp
+++ b/opentrack/keybinding-worker.cpp
@@ -126,8 +126,9 @@ void KeybindingWorker::run() {
for (int i = 0; i < 256; i++)
{
Key k;
- if (old_keystate[i] != keystate[i] && keystate[i] & 0x80)
+ if (old_keystate[i] != keystate[i])
{
+ const bool held = keystate[i] & 0x80;
switch (i)
{
case DIK_LCONTROL:
@@ -142,6 +143,7 @@ void KeybindingWorker::run() {
k.alt = !!(keystate[DIK_LALT] & 0x80) || !!(keystate[DIK_RALT] & 0x80);
k.ctrl = !!(keystate[DIK_LCONTROL] & 0x80) || !!(keystate[DIK_RCONTROL] & 0x80);
k.keycode = i;
+ k.held = held;
for (auto& r : receivers)
r->operator()(k);