summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-25 16:42:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-25 16:42:31 +0100
commit18efc635a8d8cbe877701f519704c0bb16158e3c (patch)
treeafe0654402051f925428a4cc579028f5a721185b
parenta176bc811bf906b8c6816d0444eac979facf688c (diff)
shortcuts: allow for numpad on win32
Closes #259
-rw-r--r--opentrack/win32-shortcuts.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/opentrack/win32-shortcuts.cpp b/opentrack/win32-shortcuts.cpp
index e3a5448e..350d99c3 100644
--- a/opentrack/win32-shortcuts.cpp
+++ b/opentrack/win32-shortcuts.cpp
@@ -121,6 +121,26 @@ QList<win_key> windows_key_sequences =
win_key(DIK_SCROLL, Qt::Key::Key_ScrollLock),
win_key(DIK_PAUSE, Qt::Key::Key_Pause),
win_key(DIK_NUMLOCK, Qt::Key::Key_NumLock),
+#define mod(x, y) static_cast<Qt::Key>(x | y)
+ win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD0, mod(Qt::Key::Key_0, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD1, mod(Qt::Key::Key_1, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD2, mod(Qt::Key::Key_2, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD3, mod(Qt::Key::Key_3, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD4, mod(Qt::Key::Key_4, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD5, mod(Qt::Key::Key_5, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD6, mod(Qt::Key::Key_6, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD7, mod(Qt::Key::Key_7, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD8, mod(Qt::Key::Key_8, Qt::KeypadModifier)),
+ win_key(DIK_NUMPAD9, mod(Qt::Key::Key_9, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADCOMMA, mod(Qt::Key::Key_Comma, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADENTER, mod(Qt::Key::Key_Enter, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADEQUALS, mod(Qt::Key::Key_Equal, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADMINUS, mod(Qt::Key::Key_Minus, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADPERIOD, mod(Qt::Key::Key_Period, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADPLUS, mod(Qt::Key::Key_Plus, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADSLASH, mod(Qt::Key::Key_Slash, Qt::KeypadModifier)),
+ win_key(DIK_NUMPADSTAR, mod(Qt::Key::Key_multiply, Qt::KeypadModifier)),
});
bool win_key::to_qt(const Key& k, QKeySequence& qt_, Qt::KeyboardModifiers &mods)