[SDL] Strangle problem using keys

Alan Wolfe atrix2 at cox.net
Tue Nov 1 12:17:42 PST 2005


It's not the same if keys[SDLK_UP] is 2 or any other number besides 1 and 0

----- Original Message ----- 
From: "ALTAIR -" <altairdiv at hotmail.com>
To: <sdl at libsdl.org>
Sent: Tuesday, November 01, 2005 11:36 AM
Subject: Re: [SDL] Strangle problem using keys


>
> If (keys[SDLK_UP]== 1)
>
> is the same what:
>
> If (keys[SDLK_UP])
>
> >From: Martin Storsjö <martin at martin.st>
> >Reply-To: "A list for developers using the SDL library.
> >(includesSDL-announce)" <sdl at libsdl.org>
> >To: "A list for developers using the SDL library. (includes
> >SDL-announce)"<sdl at libsdl.org>
> >Subject: Re: [SDL] Strangle problem using keys
> >Date: Tue, 1 Nov 2005 19:08:32 +0200 (EET)
> >
> >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
> >
> >_______________________________________________
> >SDL mailing list
> >SDL at libsdl.org
> >http://www.libsdl.org/mailman/listinfo/sdl
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>





More information about the SDL mailing list