diff options
| author | srdusr <[email protected]> | 2024-03-25 20:09:00 +0200 |
|---|---|---|
| committer | srdusr <[email protected]> | 2024-03-25 20:09:00 +0200 |
| commit | 0ea49730db789f60349d49187fee2896a947646d (patch) | |
| tree | ff1309a93bfc9f7a0440aff4dfcee088d1009433 /src/input/input_handler.h | |
| parent | 1e1dc93c21a0ba994830bc463c3af1d3ac169fbb (diff) | |
| download | srdwm-0ea49730db789f60349d49187fee2896a947646d.tar.gz srdwm-0ea49730db789f60349d49187fee2896a947646d.zip | |
Initial Commit
Diffstat (limited to 'src/input/input_handler.h')
| -rw-r--r-- | src/input/input_handler.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/input/input_handler.h b/src/input/input_handler.h new file mode 100644 index 0000000..2f35608 --- /dev/null +++ b/src/input/input_handler.h @@ -0,0 +1,36 @@ +#ifndef SRDWM_INPUT_HANDLER_H +#define SRDWM_INPUT_HANDLER_H + +#include <memory> + +// Define basic event structures (these will need more detail later) +struct KeyboardEvent { + int key_code; + // Add modifiers, state (press/release) +}; + +struct MouseEvent { + enum class Type { Press, Release, Motion }; + Type type; + int button; // Valid for Press/Release + int x, y; + // Add modifiers +}; + +class InputHandler { +public: + virtual ~InputHandler() = default; + + // Pure virtual methods for handling events + virtual void handle_key_press(const KeyboardEvent& event) = 0; + virtual void handle_key_release(const KeyboardEvent& event) = 0; + virtual void handle_mouse_button_press(const MouseEvent& event) = 0; + virtual void handle_mouse_button_release(const MouseEvent& event) = 0; + virtual void handle_mouse_motion(const MouseEvent& event) = 0; + + // Other potential input-related methods + // virtual void initialize() = 0; + // virtual void shutdown() = 0; +}; + +#endif // SRDWM_INPUT_HANDLER_H |