diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-03-29 22:49:36 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-03-29 22:49:36 +0200 |
commit | 9baeb3bd1afb26c1525939ed75ba70486ffe24bf (patch) | |
tree | 8adb918f329071cbb683913d482c51606abb45b9 /src/wx/scancode_wx2sdl.h | |
parent | 41f4ad6620b5acb54abc97631ddc982727e92b10 (diff) |
tweaks
Diffstat (limited to 'src/wx/scancode_wx2sdl.h')
-rw-r--r-- | src/wx/scancode_wx2sdl.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/wx/scancode_wx2sdl.h b/src/wx/scancode_wx2sdl.h index 466548d..1091a1c 100644 --- a/src/wx/scancode_wx2sdl.h +++ b/src/wx/scancode_wx2sdl.h @@ -299,26 +299,33 @@ SDL_Scancode scancode_wx2sdl(wxKeyEvent& event) int keysym = event.GetRawKeyCode(); - if (keysym == NoSymbol) { + if (keysym == NoSymbol) + { return SDL_SCANCODE_UNKNOWN; } - if (keysym >= GDK_a && keysym <= GDK_z) { - return SDL_SCANCODE_A + (keysym - GDK_a); + if (keysym >= GDK_a && keysym <= GDK_z) + { + return (SDL_Scancode)(SDL_SCANCODE_A + (keysym - GDK_a)); } - if (keysym >= GDK_A && keysym <= GDK_Z) { - return SDL_SCANCODE_A + (keysym - GDK_A); + if (keysym >= GDK_A && keysym <= GDK_Z) + { + return (SDL_Scancode)(SDL_SCANCODE_A + (keysym - GDK_A)); } - if (keysym == GDK_0) { + if (keysym == GDK_0) + { return SDL_SCANCODE_0; } - if (keysym >= GDK_1 && keysym <= GDK_9) { - return SDL_SCANCODE_1 + (keysym - GDK_1); + if (keysym >= GDK_1 && keysym <= GDK_9) + { + return (SDL_Scancode)(SDL_SCANCODE_1 + (keysym - GDK_1)); } - for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) { - if (keysym == KeySymToSDLScancode[i].keysym) { + for (i = 0; i < SDL_arraysize(KeySymToSDLScancode); ++i) + { + if (keysym == KeySymToSDLScancode[i].keysym) + { return KeySymToSDLScancode[i].scancode; } } |