aboutsummaryrefslogtreecommitdiff
path: root/ttwhy/event.cppm
diff options
context:
space:
mode:
Diffstat (limited to 'ttwhy/event.cppm')
-rw-r--r--ttwhy/event.cppm48
1 files changed, 48 insertions, 0 deletions
diff --git a/ttwhy/event.cppm b/ttwhy/event.cppm
new file mode 100644
index 0000000..3a81bff
--- /dev/null
+++ b/ttwhy/event.cppm
@@ -0,0 +1,48 @@
+module;
+
+#include <variant>
+
+export module ttwhy:event;
+
+namespace ttwhy
+{
+ export enum class control_key
+ {
+ del,
+ enter,
+ escape,
+ tab,
+ backspace,
+ };
+
+ export enum class navigation_key
+ {
+ up,
+ down,
+ left,
+ right,
+ home,
+ end,
+ delete_key,
+ insert_key,
+ page_up,
+ page_down,
+ };
+
+ export struct character_event
+ {
+ char value;
+ };
+
+ export struct control_event
+ {
+ control_key key;
+ };
+
+ export struct navigation_event
+ {
+ navigation_key key;
+ };
+
+ export using input_event = std::variant<character_event, control_event, navigation_event>;
+} // namespace ttwhy