[SDL] Problems using a joystick as a cursor

Bill Kendrick nbs at sonic.net
Sun Feb 11 23:33:21 PST 2007


On Mon, Feb 12, 2007 at 12:11:44AM +1300, Glenn McCord wrote:
> I have a question about using the joystick as a cursor because I
> intend to use it on the PSP.
<snip> 
> What makes this interesting is that when the joystick is still, but
> not in a neutral position, the cursor should still be moving.

So why not just keep moving it, until it DOES return to neutral?

e.g., when you receive an event, set some variables that record
the stick's position.  Then use THOSE variables, rather than the
events (which only come in during changes, it sounds like).


Admittedly, haven't touched a PSP in quite a few months (sadly,
didn't sund like a very interesting gaming platform...) so I can't
remember what the joystick does, or what it feels like.
(Compared to, say, a Nintendo NES pad or Atari 2600 stick :) )

-bill1


More information about the SDL mailing list