Mercurial > sdl-ios-xcode
comparison src/video/android/SDL_androidkeyboard.c @ 4980:d9fdff945ec9
A bit of cleanup in the Android driver
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 12 Jan 2011 13:52:41 -0800 |
parents | |
children | 3c9058f3ffe7 |
comparison
equal
deleted
inserted
replaced
4979:be4ba07d9867 | 4980:d9fdff945ec9 |
---|---|
1 /* | |
2 SDL - Simple DirectMedia Layer | |
3 Copyright (C) 1997-2010 Sam Lantinga | |
4 | |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Lesser General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2.1 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Lesser General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Lesser General Public | |
16 License along with this library; if not, write to the Free Software | |
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
18 | |
19 Sam Lantinga | |
20 slouken@libsdl.org | |
21 */ | |
22 #include "SDL_config.h" | |
23 | |
24 #include "../../events/SDL_events_c.h" | |
25 | |
26 #include "SDL_androidkeyboard.h" | |
27 | |
28 | |
29 void Android_InitKeyboard() | |
30 { | |
31 SDLKey keymap[SDL_NUM_SCANCODES]; | |
32 | |
33 /* Add default scancode to key mapping */ | |
34 SDL_GetDefaultKeymap(keymap); | |
35 SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES); | |
36 } | |
37 | |
38 int | |
39 Android_OnKeyDown(int keycode) | |
40 { | |
41 /* FIXME: Need conversion from Android keycode to SDL scancode */ | |
42 return SDL_SendKeyboardKey(SDL_PRESSED, (SDL_scancode)keycode); | |
43 } | |
44 | |
45 int | |
46 Android_OnKeyUp(int keycode) | |
47 { | |
48 /* FIXME: Need conversion from Android keycode to SDL scancode */ | |
49 return SDL_SendKeyboardKey(SDL_RELEASED, (SDL_scancode)keycode); | |
50 } | |
51 | |
52 /* vi: set ts=4 sw=4 expandtab: */ |