Don't use ESC and F1-F12 buttons in keyboard input #492

This commit is contained in:
BADIM-PC\Vadim
2018-01-03 15:52:12 +03:00
parent 1e09c653ec
commit 1f7823ea6e
6 changed files with 32 additions and 34 deletions

View File

@@ -793,9 +793,9 @@ static s32 lua_key(lua_State* lua)
}
else if (top == 1)
{
tic_key key = getLuaNumber(lua, 1) + TIC_KEY_START_INDEX;
tic_key key = getLuaNumber(lua, 1);
if(key < TIC_KEYS_COUNT)
if(key < tic_keys_count)
lua_pushboolean(lua, tic->api.key(tic, key));
else
{
@@ -825,9 +825,9 @@ static s32 lua_keyp(lua_State* lua)
}
else
{
tic_key key = getLuaNumber(lua, 1) + TIC_KEY_START_INDEX;
tic_key key = getLuaNumber(lua, 1);
if(key >= TIC_KEYS_COUNT)
if(key >= tic_keys_count)
{
luaL_error(lua, "unknown keyboard code\n");
}