diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-05 12:48:50 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-05 12:48:50 (GMT) |
| commit | 8f8de875c6f7a68a3e47252a8653abb72fd398c1 (patch) | |
| tree | d2079a8422c3b591e3e31e272358825e0a597da3 /src/cat/LuaScriptInterface.cpp | |
| parent | ea51cde1f07d2a63f824e78c44adad0993115853 (diff) | |
| download | powder-8f8de875c6f7a68a3e47252a8653abb72fd398c1.zip powder-8f8de875c6f7a68a3e47252a8653abb72fd398c1.tar.gz | |
Modifier keys for Lua, Air display, correct render mode saving
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
| -rw-r--r-- | src/cat/LuaScriptInterface.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp index 3da7284..bd0f013 100644 --- a/src/cat/LuaScriptInterface.cpp +++ b/src/cat/LuaScriptInterface.cpp @@ -242,12 +242,26 @@ bool LuaScriptInterface::OnMouseWheel(int x, int y, int d) bool LuaScriptInterface::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { - return luacon_keyevent(key, /*TODO: sdl_mod*/0, LUACON_KDOWN); + int modifiers; + if(shift) + modifiers |= 0x001; + if(ctrl) + modifiers |= 0x040; + if(alt) + modifiers |= 0x100; + return luacon_keyevent(key, modifiers, LUACON_KDOWN); } bool LuaScriptInterface::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt) { - return luacon_keyevent(key, /*TODO: sdl_mod*/0, LUACON_KUP); + int modifiers; + if(shift) + modifiers |= 0x001; + if(ctrl) + modifiers |= 0x040; + if(alt) + modifiers |= 0x100; + return luacon_keyevent(key, modifiers, LUACON_KUP); } void LuaScriptInterface::OnTick() |
