From c6262346b45b6c84fd1a009f21465d3af1b63593 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 18 Jun 2026 15:33:43 +0200 Subject: lib: prepare for state machine --- ttwhy/event.cppm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ ttwhy/lib.cppm | 1 + 2 files changed, 49 insertions(+) create mode 100644 ttwhy/event.cppm (limited to 'ttwhy') 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 + +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; +} // namespace ttwhy diff --git a/ttwhy/lib.cppm b/ttwhy/lib.cppm index 14e0d5c..b7766bd 100644 --- a/ttwhy/lib.cppm +++ b/ttwhy/lib.cppm @@ -1,4 +1,5 @@ export module ttwhy; +export import :event; export import :io; export import :scoped_attributes; -- cgit v1.2.3