diff --git a/src/delegates.hpp b/src/delegates.hpp index 32492164..0e670b41 100644 --- a/src/delegates.hpp +++ b/src/delegates.hpp @@ -8,6 +8,8 @@ using runnable = std::function; template using supplier = std::function; template using consumer = std::function; +using KeyCallback = std::function; + // data sources using wstringsupplier = std::function; using doublesupplier = std::function; diff --git a/src/logic/scripting/lua/lua_util.cpp b/src/logic/scripting/lua/lua_util.cpp index cdccc12a..18caca40 100644 --- a/src/logic/scripting/lua/lua_util.cpp +++ b/src/logic/scripting/lua/lua_util.cpp @@ -247,7 +247,7 @@ runnable lua::create_runnable(State* L) { }; } -supplier lua::create_simple_handler(State* L) { +KeyCallback lua::create_simple_handler(State* L) { auto funcptr = create_lambda_handler(L); return [=]() -> bool { getglobal(L, LAMBDAS_TABLE); diff --git a/src/logic/scripting/lua/lua_util.hpp b/src/logic/scripting/lua/lua_util.hpp index 4c96ef57..2748d175 100644 --- a/src/logic/scripting/lua/lua_util.hpp +++ b/src/logic/scripting/lua/lua_util.hpp @@ -574,7 +574,7 @@ namespace lua { } runnable create_runnable(lua::State*); - supplier create_simple_handler(lua::State*); + KeyCallback create_simple_handler(lua::State*); scripting::common_func create_lambda(lua::State*); scripting::common_func create_lambda_nothrow(lua::State*); diff --git a/src/window/Events.hpp b/src/window/Events.hpp index 9cf3074d..67ab111a 100644 --- a/src/window/Events.hpp +++ b/src/window/Events.hpp @@ -4,6 +4,7 @@ #include #include +#include "delegates.hpp" #include "typedefs.hpp" #include "input.hpp" @@ -20,8 +21,6 @@ class Events { static uint currentFrame; static bool cursor_drag; public: - using KeyCallback = std::function; - static int scroll; static glm::vec2 delta; static glm::vec2 cursor;