summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-02-11 16:45:49 (GMT)
committer jacob1 <jfu614@gmail.com>2013-02-11 16:45:49 (GMT)
commit5807602cc1ec326f3ca33f3130d35b22082378ec (patch)
tree53b9ea62bb026ba976118bfe3e78dc5a3cd4faee /src/cat/LuaScriptInterface.cpp
parent4e918ab76d01bfdd24416d8c59acfaef0ea61db1 (diff)
downloadpowder-5807602cc1ec326f3ca33f3130d35b22082378ec.zip
powder-5807602cc1ec326f3ca33f3130d35b22082378ec.tar.gz
fix modifiers from lua, fix right ctrl
Diffstat (limited to 'src/cat/LuaScriptInterface.cpp')
-rw-r--r--src/cat/LuaScriptInterface.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/cat/LuaScriptInterface.cpp b/src/cat/LuaScriptInterface.cpp
index e4bf3c2..b4ce48a 100644
--- a/src/cat/LuaScriptInterface.cpp
+++ b/src/cat/LuaScriptInterface.cpp
@@ -43,6 +43,7 @@
#ifndef WIN
#include <unistd.h>
#endif
+#include "SDL.h"
extern "C"
{
@@ -1887,14 +1888,7 @@ bool LuaScriptInterface::OnMouseWheel(int x, int y, int d)
bool LuaScriptInterface::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
{
- int modifiers = 0;
- if(shift)
- modifiers |= 0x001;
- if(ctrl)
- modifiers |= 0x040;
- if(alt)
- modifiers |= 0x100;
- return luacon_keyevent(key, modifiers, LUACON_KDOWN);
+ return luacon_keyevent(key, SDL_GetModState(), LUACON_KDOWN);
}
bool LuaScriptInterface::OnKeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt)