[SDL] Strangle problem using keys

Martin Storsjö martin at martin.st
Tue Nov 1 09:08:32 PST 2005


On Tue, 1 Nov 2005, ALTAIR - wrote:

> if (keys[SDLK_UP]== 1) { move_up(); }
> if (keys[SDLK_DOWN]== 1) { move_down(); }
>
> Is this correct?. I am using SDL-1.2.8 (the stable version when all was 
> installed). No errors when I compile on my Linux, but the key are not 
> detected.

I'd suggest trying

if (keys[SDLK_UP])

instead, since it could be any value except zero.

// Martin




More information about the SDL mailing list