diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-20 22:10:57 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-20 22:10:57 +0530 |
| commit | fdeb33d34a97d062a120f72da919f81d7b1d45bf (patch) | |
| tree | 91165d5e3e718d4008bf73259f45d1705965f4b0 /include/keymap/KeymapEvaluator.hpp | |
| parent | 9e3474b5d8ee4afdd9c03cfb4a151ffebfca36b7 (diff) | |
| download | null-browser-fdeb33d34a97d062a120f72da919f81d7b1d45bf.tar.gz null-browser-fdeb33d34a97d062a120f72da919f81d7b1d45bf.zip | |
Move header files to src
Diffstat (limited to 'include/keymap/KeymapEvaluator.hpp')
| -rw-r--r-- | include/keymap/KeymapEvaluator.hpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/include/keymap/KeymapEvaluator.hpp b/include/keymap/KeymapEvaluator.hpp deleted file mode 100644 index db93900..0000000 --- a/include/keymap/KeymapEvaluator.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include <QWidget> -#include <QtCore/qmap.h> -#include <QtCore/qnamespace.h> -#include <QtCore> -#include <functional> - -#include "keymap/KeySeqParser.hpp" -#include "utils.hpp" - -typedef std::function<void()> KeyAction; - -struct KeyMap { - KeySequence keySequence; - KeyAction action; -}; - -enum KeyMode { Normal, Insert }; - -class KeymapEvaluator : public QObject { - Q_OBJECT - -public: - KeymapEvaluator(); - - void addKeymap(KeyMode mode, QString key, KeyAction action); - bool evaluate(Qt::KeyboardModifiers modifiers, Qt::Key key); - - DEFINE_SETTER(setCurrentMode, currentMode) - DEFINE_GETTER(getCurrentMode, currentMode) - -private: - const QList<KeyMap> *currentModeKeys(); - bool isInsertableMode(); - -private: - QMap<KeyMode, QList<KeyMap>> modalKeys; - KeySeqParser keySeqParser; - KeyMode currentMode = KeyMode::Normal; - KeySequence activeKeySequence; -}; |
