Basic shell working.

This commit is contained in:
2025-11-29 17:54:55 -08:00
parent 46c7a4e8a2
commit 69e7959fa4
24 changed files with 1631 additions and 55 deletions

31
GUIInputHandler.h Normal file
View File

@@ -0,0 +1,31 @@
/*
* GUIInputHandler - ImGui/SDL2-based input mapping for GUI mode
*/
#ifndef KTE_GUI_INPUT_HANDLER_H
#define KTE_GUI_INPUT_HANDLER_H
#include <queue>
#include <mutex>
#include "InputHandler.h"
union SDL_Event; // fwd decl to avoid including SDL here (SDL defines SDL_Event as a union)
class GUIInputHandler : public InputHandler {
public:
GUIInputHandler() = default;
~GUIInputHandler() override = default;
// Translate an SDL event to editor command and enqueue if applicable.
// Returns true if it produced a mapped command or consumed input.
bool ProcessSDLEvent(const SDL_Event &e);
bool Poll(MappedInput &out) override;
private:
std::mutex mu_;
std::queue<MappedInput> q_;
bool k_prefix_ = false;
};
#endif // KTE_GUI_INPUT_HANDLER_H