[SDL] WinCE timers, continued

Ryan C. Gordon icculus at icculus.org
Mon Nov 21 23:13:50 PST 2005


from the wiki
SDL_GetKeyState()
" A value of 1 means that the key is pressed and a value of 0 means that it
is not "

did you try the SDL_PollEvent to clear the event loop?

i imagine if GetKeyState didnt work on linux it would be well documented as
SDL is used...

something like this

void update_input()
{
SDL_Event event;
while( SDL_PollEvent( &event ) )
{
if( event.type == SDL_QUIT )
//do something....
}
Uint8 *keys;
keys=SDL_GetKeyState(NULL);

if (keys[SDLK_UP]== 1) { move_up(); }
if (keys[SDLK_DOWN]== 1) { move_down(); }
}

i cant see any reason why it wouldn't work.

please post code if you want more help...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20051101/1b380436/attachment-0008.htm>


More information about the SDL mailing list