summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--facetracknoir/keyboard.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/facetracknoir/keyboard.h b/facetracknoir/keyboard.h
index ccfd7a84..a7673f8f 100644
--- a/facetracknoir/keyboard.h
+++ b/facetracknoir/keyboard.h
@@ -2,6 +2,7 @@
#include "ui_keyboard_listener.h"
#include <QLabel>
#include <QKeyEvent>
+#include <QDebug>
class KeyboardListener : public QLabel
{
@@ -15,18 +16,21 @@ public:
}
void keyPressEvent(QKeyEvent* event) override
{
+ //qDebug() << "k" << (event->key() | event->modifiers());
+ switch (event->key() | event->modifiers())
{
- switch (event->key() | event->modifiers())
- {
- case 83886113: // ctrl
- case 50331680: // shift
- case 150994979: // alt
- case 16777250: // meta
- return;
- default: break;
- }
+ case 83886113: // ctrl
+ case 50331680: // shift
+ case 150994979: // alt
+ case 218103841: // ctrl+alt
+ case 117440545: // ctrl+shift
+ case 184549408: // alt+shift
+ case 251658272: // ctrl+alt+shift
+ break;
+ default:
+ emit key_pressed(QKeySequence(event->key() | event->modifiers()));
+ break;
}
- emit key_pressed(QKeySequence(event->key() | event->modifiers()));
}
signals:
void key_pressed(QKeySequence k);