2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
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.
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.
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
22 #include "SDL_config.h"
24 /* Being a nds driver, there's no event stream. We just define stubs for
28 #include "../../events/SDL_sysevents.h"
29 #include "../../events/SDL_events_c.h"
30 #include "SDL_ndsvideo.h"
31 #include "SDL_ndsevents_c.h"
33 static SDLKey keymap[NDS_NUMKEYS];
34 char keymem[NDS_NUMKEYS]; /* memorize states of buttons */
36 void NDS_PumpEvents(_THIS)
42 for(i=0;i<NDS_NUMKEYS;i++)
46 if(keysHeld()&(1<<i) && !keymem[i])
49 //printf("key released %d\n",i);
50 SDL_PrivateKeyboard(SDL_RELEASED, &keysym);
52 if(!(keysHeld()&(1<<i)) && keymem[i])
55 //printf("key pressed %d\n",i);
56 SDL_PrivateKeyboard(SDL_PRESSED, &keysym);
59 //touchPosition touch;
60 //touch=touchReadXY();
61 //if (touch.px!=0 || touch.py!=0)
62 // SDL_PrivateMouseMotion(SDL_PRESSED, 0, touch.px, touch.py);
65 void NDS_InitOSKeymap(_THIS)
67 SDL_memset(keymem,1,NDS_NUMKEYS);
74 keymap[KEY_UP]=SDLK_UP;
75 keymap[KEY_DOWN]=SDLK_DOWN;
76 keymap[KEY_LEFT]=SDLK_LEFT;
77 keymap[KEY_RIGHT]=SDLK_RIGHT;
78 keymap[KEY_SELECT]=SDLK_SPACE;
79 keymap[KEY_START]=SDLK_RETURN;
82 /* end of SDL_gbaevents.c ... */