Mercurial > sdl-ios-xcode
comparison src/video/android/SDL_androidevents.c @ 4938:2af0032520d8
Fixed compiling on Android
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 31 Dec 2010 16:51:03 -0800 |
parents | f2c2a33a1a38 |
children | d9fdff945ec9 |
comparison
equal
deleted
inserted
replaced
4937:24d44c7c4c63 | 4938:2af0032520d8 |
---|---|
30 #include "../../events/SDL_sysevents.h" | 30 #include "../../events/SDL_sysevents.h" |
31 #include "../../events/SDL_events_c.h" | 31 #include "../../events/SDL_events_c.h" |
32 | 32 |
33 #include "SDL_androidevents.h" | 33 #include "SDL_androidevents.h" |
34 | 34 |
35 void Android_InitEvents(){ | 35 void Android_InitEvents() |
36 | 36 { |
37 SDL_Keyboard keyboard; | |
38 | |
39 SDL_zero(keyboard); | |
40 SDL_AddKeyboard(&keyboard, -1); | |
41 | |
42 SDLKey keymap[SDL_NUM_SCANCODES]; | 37 SDLKey keymap[SDL_NUM_SCANCODES]; |
43 | 38 |
44 /* Add default scancode to key mapping */ | 39 /* Add default scancode to key mapping */ |
45 SDL_GetDefaultKeymap(keymap); | 40 SDL_GetDefaultKeymap(keymap); |
46 SDL_SetKeymap(0, 0, keymap, SDL_NUM_SCANCODES); | 41 SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); |
47 | |
48 | |
49 } | 42 } |
50 | 43 |
51 void | 44 void |
52 Android_PumpEvents(_THIS) | 45 Android_PumpEvents(_THIS) |
53 { | 46 { |
72 | 65 |
73 } | 66 } |
74 | 67 |
75 int | 68 int |
76 Android_OnKeyDown(int keycode){ | 69 Android_OnKeyDown(int keycode){ |
77 return SDL_SendKeyboardKey(0, SDL_PRESSED, (SDL_scancode)keycode); | 70 return SDL_SendKeyboardKey(SDL_PRESSED, (SDL_scancode)keycode); |
78 } | 71 } |
79 | 72 |
80 int | 73 int |
81 Android_OnKeyUp(int keycode){ | 74 Android_OnKeyUp(int keycode){ |
82 return SDL_SendKeyboardKey(0, SDL_RELEASED, (SDL_scancode)keycode); | 75 return SDL_SendKeyboardKey(SDL_RELEASED, (SDL_scancode)keycode); |
83 } | 76 } |
84 | 77 |
85 /* vi: set ts=4 sw=4 expandtab: */ | 78 /* vi: set ts=4 sw=4 expandtab: */ |