From e2218d042945a870934f832ad5707b81db175bcb Mon Sep 17 00:00:00 2001 From: myk002 Date: Mon, 21 Nov 2022 17:35:14 -0800 Subject: [PATCH] make mouse button event behavior conform to docs before, when a mouse button was held down, we'd send a single _MOUSE_L and _MOUSE_L_DOWN event and that's it. now we properly send a single _MOUSE_L_DOWN event and _MOUSE_L events for as long as the button is held down. similar for the right mouse button --- library/LuaTools.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/LuaTools.cpp b/library/LuaTools.cpp index 8d317c076..5b080ce43 100644 --- a/library/LuaTools.cpp +++ b/library/LuaTools.cpp @@ -156,21 +156,21 @@ void DFHack::Lua::PushInterfaceKeys(lua_State *L, if (df::global::enabler) { if (df::global::enabler->mouse_lbut_down) { lua_pushboolean(L, true); - lua_setfield(L, -2, "_MOUSE_L"); + lua_setfield(L, -2, "_MOUSE_L_DOWN"); } if (df::global::enabler->mouse_rbut_down) { lua_pushboolean(L, true); - lua_setfield(L, -2, "_MOUSE_R"); + lua_setfield(L, -2, "_MOUSE_R_DOWN"); } if (df::global::enabler->mouse_lbut) { lua_pushboolean(L, true); - lua_setfield(L, -2, "_MOUSE_L_DOWN"); - df::global::enabler->mouse_lbut = 0; + lua_setfield(L, -2, "_MOUSE_L"); + df::global::enabler->mouse_lbut_down = 0; } if (df::global::enabler->mouse_rbut) { lua_pushboolean(L, true); - lua_setfield(L, -2, "_MOUSE_R_DOWN"); - df::global::enabler->mouse_rbut = 0; + lua_setfield(L, -2, "_MOUSE_R"); + df::global::enabler->mouse_rbut_down = 0; } } }