[SDL] repeat for joybutton?
paris at parisgraphics.com
paris at parisgraphics.com
Mon Aug 6 19:55:33 PDT 2007
Hi Lilith,
Thanks for the reply - yes, that makes perfect sense.
Best,
p
-------- Original Message --------
Subject: Re: [SDL] repeat for joybutton?
From: "Lilith Calbridge" <lilith at dcccd.edu>
Date: Mon, August 06, 2007 10:48 pm
To: <sdl at lists.libsdl.org>
>>> On 8/6/2007 at 7:37 PM, <paris at parisgraphics.com> wrote:
> Hi List,
> I'm new to the list and to SDL.
> I've been experimenting with it on Linux, Mac, Windows and GP2x (my
main
> interest with SDL).
> I have a question (searched the archives first, but couldn't find an
> answer) and would appreciate any help.
> When a program is reacting to keyboard input, I can use
> SDL_EnableKeyRepeat
> and as long as the key that I'm polling for is held down, do
something.
> How is this done with a joystick?
> For example, with SDL_JOYBUTTONDOWN - so that the user doesn't have
to
> repeatedly press?
Probably due to the way the OS handles joystick buttons as opposed to
keyboards. I'd figure you're going to have to design your own handling
on this. I'd envision a code that sets a boolean like JButtonStillDown
that gets set to true when the system detects the button down and false
when it detects the button up. In between you'd have to keep track of
the ticks and maybe every 100 ticks, if it's still down, fire a shot.
--
Lilith
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
More information about the SDL
mailing list