[SDL] repeat for joybutton?
Jonathan Dearborn
grimfang4 at hotmail.com
Wed Aug 8 07:21:10 PDT 2007
Hey,
If you just want the joy button to repeat each frame instead of having a delay like the key repeat has, you can check the joy button state with:Uint8 SDL_JoystickGetButton(SDL_Joystick *joystick, int button);
Jonny D
> Date: Mon, 6 Aug 2007 19:55:33 -0700> From: paris at parisgraphics.com> To: sdl at lists.libsdl.org> Subject: Re: [SDL] repeat for joybutton?> > 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> > > > _______________________________________________> SDL mailing list> SDL at lists.libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_________________________________________________________________
See what you’re getting into…before you go there
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070808/57f975d3/attachment.htm
More information about the SDL
mailing list