| 1906 | } |
| 1907 | |
| 1908 | static int hotkey_removeKeybind(lua_State *L) { |
| 1909 | auto hotkey_mgr = Core::getInstance().getHotkeyManager(); |
| 1910 | if (!hotkey_mgr) { |
| 1911 | lua_pushboolean(L, false); |
| 1912 | return 1; |
| 1913 | } |
| 1914 | |
| 1915 | bool res = false; |
| 1916 | switch (lua_gettop(L)) { |
| 1917 | case 1: |
| 1918 | luaL_checkstring(L, -1); |
| 1919 | res = hotkey_mgr->removeKeybind(lua_tostring(L, -1)); |
| 1920 | break; |
| 1921 | case 2: |
| 1922 | luaL_checkstring(L, -2); |
| 1923 | res = hotkey_mgr->removeKeybind(lua_tostring(L, -2), lua_toboolean(L, -1)); |
| 1924 | break; |
| 1925 | case 3: |
| 1926 | luaL_checkstring(L, -3); |
| 1927 | luaL_checkstring(L, -1); |
| 1928 | res = hotkey_mgr->removeKeybind( |
| 1929 | lua_tostring(L, -3), |
| 1930 | lua_toboolean(L, -2), |
| 1931 | lua_tostring(L, -1) |
| 1932 | ); |
| 1933 | break; |
| 1934 | } |
| 1935 | |
| 1936 | lua_pushboolean(L, res); |
| 1937 | return 1; |
| 1938 | } |
| 1939 | |
| 1940 | void hotkey_pushBindArray(lua_State *L, const std::vector<Hotkey::KeyBinding>& binds) { |
| 1941 | lua_createtable(L, binds.size(), 0); |
nothing calls this directly
no test coverage detected