This commit is contained in:
StapleButter 2017-03-29 22:49:36 +02:00
parent 41f4ad6620
commit 9baeb3bd1a
2 changed files with 20 additions and 11 deletions

View File

@ -40,8 +40,10 @@
<Add option="-Wall" /> <Add option="-Wall" />
<Add option="-m64" /> <Add option="-m64" />
<Add option="-fexceptions" /> <Add option="-fexceptions" />
<Add option="-pipe" />
<Add option="-I$(TARGET_COMPILER_DIR)/lib/wx/include/msw-unicode-static-3.0 -I$(TARGET_COMPILER_DIR)/include/wx-3.0" /> <Add option="-I$(TARGET_COMPILER_DIR)/lib/wx/include/msw-unicode-static-3.0 -I$(TARGET_COMPILER_DIR)/include/wx-3.0" />
<Add option="-D_FILE_OFFSET_BITS=64 -D__WXMSW__ -pipe" /> <Add option="-D_FILE_OFFSET_BITS=64" />
<Add option="-D__WXMSW__" />
</Compiler> </Compiler>
<Linker> <Linker>
<Add option="-m64" /> <Add option="-m64" />

View File

@ -299,26 +299,33 @@ SDL_Scancode scancode_wx2sdl(wxKeyEvent& event)
int keysym = event.GetRawKeyCode(); int keysym = event.GetRawKeyCode();
if (keysym == NoSymbol) { if (keysym == NoSymbol)
{
return SDL_SCANCODE_UNKNOWN; return SDL_SCANCODE_UNKNOWN;
} }
if (keysym >= GDK_a && keysym <= GDK_z) { if (keysym >= GDK_a && keysym <= GDK_z)
return SDL_SCANCODE_A + (keysym - GDK_a); {
return (SDL_Scancode)(SDL_SCANCODE_A + (keysym - GDK_a));
} }
if (keysym >= GDK_A && keysym <= GDK_Z) { if (keysym >= GDK_A && keysym <= GDK_Z)
return SDL_SCANCODE_A + (keysym - GDK_A); {
return (SDL_Scancode)(SDL_SCANCODE_A + (keysym - GDK_A));
} }
if (keysym == GDK_0) { if (keysym == GDK_0)
{
return SDL_SCANCODE_0; return SDL_SCANCODE_0;
} }
if (keysym >= GDK_1 && keysym <= GDK_9) { if (keysym >= GDK_1 && keysym <= GDK_9)
return SDL_SCANCODE_1 + (keysym - GDK_1); {
return (SDL_Scancode)(SDL_SCANCODE_1 + (keysym - GDK_1));
} }
for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) { for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i)
if (keysym == KeySymToSDLScancode[i].keysym) { {
if (keysym == KeySymToSDLScancode[i].keysym)
{
return KeySymToSDLScancode[i].scancode; return KeySymToSDLScancode[i].scancode;
} }
} }