add input.add_callback("key:...") support

This commit is contained in:
MihailRis
2024-12-25 14:08:22 +03:00
parent 5e76cdfadc
commit 96577ee041
4 changed files with 46 additions and 2 deletions
+3
View File
@@ -27,6 +27,7 @@ public:
static std::vector<uint> codepoints;
static std::vector<keycode> pressedKeys;
static std::unordered_map<std::string, Binding> bindings;
static std::unordered_map<keycode, util::RunnablesList> keyCallbacks;
static void pollEvents();
@@ -50,6 +51,8 @@ public:
static bool active(const std::string& name);
static bool jactive(const std::string& name);
static observer_handler addKeyCallback(keycode key, runnable callback);
static void setKey(int key, bool b);
static void setButton(int button, bool b);