Merge pull request #494 from lethosor/fix-modstate-windows

Change MOD_* to DFH_MOD_*
develop
expwnent 2015-01-18 13:40:28 -05:00
commit b520c11627
3 changed files with 9 additions and 9 deletions

@ -1591,11 +1591,11 @@ int Core::DFH_SDL_Event(SDL::Event* ev)
auto ke = (SDL::KeyboardEvent *)ev; auto ke = (SDL::KeyboardEvent *)ev;
if (ke->ksym.sym == SDL::K_LSHIFT || ke->ksym.sym == SDL::K_RSHIFT) if (ke->ksym.sym == SDL::K_LSHIFT || ke->ksym.sym == SDL::K_RSHIFT)
modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | MOD_SHIFT : modstate & ~MOD_SHIFT; modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | DFH_MOD_SHIFT : modstate & ~DFH_MOD_SHIFT;
else if (ke->ksym.sym == SDL::K_LCTRL || ke->ksym.sym == SDL::K_RCTRL) else if (ke->ksym.sym == SDL::K_LCTRL || ke->ksym.sym == SDL::K_RCTRL)
modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | MOD_CTRL : modstate & ~MOD_CTRL; modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | DFH_MOD_CTRL : modstate & ~DFH_MOD_CTRL;
else if (ke->ksym.sym == SDL::K_LALT || ke->ksym.sym == SDL::K_RALT) else if (ke->ksym.sym == SDL::K_LALT || ke->ksym.sym == SDL::K_RALT)
modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | MOD_ALT : modstate & ~MOD_ALT; modstate = (ev->type == SDL::ET_KEYDOWN) ? modstate | DFH_MOD_ALT : modstate & ~DFH_MOD_ALT;
else if(ke->state == SDL::BTN_PRESSED && !hotkey_states[ke->ksym.sym]) else if(ke->state == SDL::BTN_PRESSED && !hotkey_states[ke->ksym.sym])
{ {
hotkey_states[ke->ksym.sym] = true; hotkey_states[ke->ksym.sym] = true;

@ -2358,13 +2358,13 @@ static int internal_getModifiers(lua_State *L)
int8_t modstate = Core::getInstance().getModstate(); int8_t modstate = Core::getInstance().getModstate();
lua_newtable(L); lua_newtable(L);
lua_pushstring(L, "shift"); lua_pushstring(L, "shift");
lua_pushboolean(L, modstate & MOD_SHIFT); lua_pushboolean(L, modstate & DFH_MOD_SHIFT);
lua_settable(L, -3); lua_settable(L, -3);
lua_pushstring(L, "ctrl"); lua_pushstring(L, "ctrl");
lua_pushboolean(L, modstate & MOD_CTRL); lua_pushboolean(L, modstate & DFH_MOD_CTRL);
lua_settable(L, -3); lua_settable(L, -3);
lua_pushstring(L, "alt"); lua_pushstring(L, "alt");
lua_pushboolean(L, modstate & MOD_ALT); lua_pushboolean(L, modstate & DFH_MOD_ALT);
lua_settable(L, -3); lua_settable(L, -3);
return 1; return 1;
} }

@ -36,9 +36,9 @@ distribution.
#include "RemoteClient.h" #include "RemoteClient.h"
#define MOD_SHIFT 1 #define DFH_MOD_SHIFT 1
#define MOD_CTRL 2 #define DFH_MOD_CTRL 2
#define MOD_ALT 4 #define DFH_MOD_ALT 4
struct WINDOW; struct WINDOW;