MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / GetCmdToKeys

Method GetCmdToKeys

src/lua/LuaCallOuts.cpp:1097–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1095
1096
1097int LuaCallOuts::GetCmdToKeys(lua_State* L) {
1098 const std::string command = luaL_checkstring(L, 1);
1099 const bool press = !lua_isboolean(L, 2) || lua_tobool(L, 2);
1100 const std::vector<std::string> keys = KEYMGR.getKeysFromCommand(command, press);
1101 lua_createtable(L, keys.size(), 0);
1102 for (size_t i = 0; i < keys.size(); i++) {
1103 lua_pushstdstring(L, keys[i]);
1104 lua_rawseti(L, -2, i + 1);
1105 }
1106 return 1;
1107}
1108
1109
1110int LuaCallOuts::GetRoamInfo(lua_State* L) {

Callers

nothing calls this directly

Calls 6

lua_toboolFunction · 0.85
lua_pushstdstringFunction · 0.85
getKeysFromCommandMethod · 0.80
lua_createtableFunction · 0.50
lua_rawsetiFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected