diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-22 20:22:21 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-08-22 20:22:21 (GMT) |
| commit | 42938cc2ea193a8a4f4a09639292f97fd1590478 (patch) | |
| tree | a0daf724e0dae8bc2ebb1b29018fd7277ac82318 /src | |
| parent | ac6feec87451b9a28e3e1546c1d7421dc550c272 (diff) | |
| download | powder-42938cc2ea193a8a4f4a09639292f97fd1590478.zip powder-42938cc2ea193a8a4f4a09639292f97fd1590478.tar.gz | |
Lua keyevents bug, int keycode is cast to a char
Diffstat (limited to 'src')
| -rw-r--r-- | src/luaconsole.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c index dc1da07..9d281c2 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -74,12 +74,13 @@ void luacon_open(){ lua_pushinteger(l, 0); lua_setfield(l, tptProperties, "mousey"); } -int luacon_keyevent(char key, int modifier, int event){ +int luacon_keyevent(int key, int modifier, int event){ int i = 0, kpcontinue = 1; + char tempkey[] = {(key, 0}; if(keypress_function_count){ for(i = 0; i < keypress_function_count && kpcontinue; i++){ lua_rawgeti(l, LUA_REGISTRYINDEX, keypress_functions[i]); - lua_pushstring(l, &key); + lua_pushstring(l, tempkey); lua_pushinteger(l, key); lua_pushinteger(l, modifier); lua_pushinteger(l, event); |
