MCPcopy Create free account
hub / github.com/DFHack/dfhack / internal_getModifiers

Function internal_getModifiers

library/LuaApi.cpp:4111–4128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4109}
4110
4111static int internal_getModifiers(lua_State *L)
4112{
4113 int8_t modstate = Core::getInstance().getModstate();
4114 lua_newtable(L);
4115 lua_pushstring(L, "shift");
4116 lua_pushboolean(L, modstate & DFH_MOD_SHIFT);
4117 lua_settable(L, -3);
4118 lua_pushstring(L, "ctrl");
4119 lua_pushboolean(L, modstate & DFH_MOD_CTRL);
4120 lua_settable(L, -3);
4121 lua_pushstring(L, "alt");
4122 lua_pushboolean(L, modstate & DFH_MOD_ALT);
4123 lua_settable(L, -3);
4124 lua_pushstring(L, "super");
4125 lua_pushboolean(L, modstate & DFH_MOD_SUPER);
4126 lua_settable(L, -3);
4127 return 1;
4128}
4129
4130static int internal_addScriptPath(lua_State *L)
4131{

Callers

nothing calls this directly

Calls 3

lua_pushstringFunction · 0.85
lua_pushbooleanFunction · 0.85
lua_settableFunction · 0.85

Tested by

no test coverage detected