another fix for lua key events

This commit is contained in:
jacob1 2016-07-17 18:19:00 -04:00
parent b8cdf4ae2f
commit 8a0496e60a

View File

@ -457,7 +457,7 @@ int luacon_keyevent(int key, Uint16 character, int modifier, int event)
for (int i = 1; i <= len && kycontinue; i++) for (int i = 1; i <= len && kycontinue; i++)
{ {
lua_rawgeti(l, -1, i); lua_rawgeti(l, -1, i);
if ((modifier & KEY_MOD_CONTROL) && (character < ' ' || character > '~')) if ((modifier & KEY_MOD_CONTROL) && (character < ' ' || character > '~') && key < 256)
lua_pushlstring(l, (const char*)&key, 1); lua_pushlstring(l, (const char*)&key, 1);
else else
lua_pushlstring(l, (const char*)&character, 1); lua_pushlstring(l, (const char*)&character, 1);