aboutsummaryrefslogtreecommitdiff
path: root/include/keymap
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-03-16 20:53:33 +0530
committerAkshay Nair <phenax5@gmail.com>2025-03-16 21:03:24 +0530
commitdd6590a0fda614fa2fb0ca9e4ad11b086393372e (patch)
tree709c9abb4ff2b24d301e40438adc03f66bffdb83 /include/keymap
parenta004334349c724dc5d3b5695dc575c9f1a3744ec (diff)
downloadnull-browser-dd6590a0fda614fa2fb0ca9e4ad11b086393372e.tar.gz
null-browser-dd6590a0fda614fa2fb0ca9e4ad11b086393372e.zip
Add simple key sequence parser
Diffstat (limited to 'include/keymap')
-rw-r--r--include/keymap/KeySeqParser.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/keymap/KeySeqParser.hpp b/include/keymap/KeySeqParser.hpp
new file mode 100644
index 0000000..aefcb62
--- /dev/null
+++ b/include/keymap/KeySeqParser.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <QtCore/qnamespace.h>
+#include <QtCore>
+
+struct KeyChord {
+ Qt::KeyboardModifiers mod;
+ Qt::Key key;
+};
+bool operator==(const KeyChord a, const KeyChord b);
+
+class KeySeqParser {
+public:
+ KeySeqParser();
+
+ QList<KeyChord> parse(QString keySequence);
+
+private:
+ Qt::Key parseKey(QString keyName);
+};