Analogue Joysticks and Linux

Hi,

I’m implementing joystick support for my game and it’s mostly working OK. The problem I am experiencing at the moment is that if the joystick is plugged in when the computer boots up, when I run the game the analogue stick is read as pointing up and left, so it starts moving immediately.

If I tap any direction on the joystick then it stops moving and is all OK with subsequent game restarts until the next time I reboot with the joystick plugged in.

Is there anything I can do to stop this from happening or is this a problem with the way the OS handles the joystick? I’m running Kubuntu Hardy 32bit.

Thanks

Richard_________________________________________________________________
View your other email accounts from your Hotmail inbox. Add them now.
http://clk.atdmt.com/UKM/go/167688463/direct/01/

Hi Richard

Into SDL docs http://www.libsdl.org/archives/SDLRef.chm, have
SDL_JoystickGetAxis:

…The value returned by SDL_JoystickGetAxis is a signed integer
(-32768 to 32768) representing the current position of the axis, it
maybe necessary to impose certain tolerances on these values to
account for jitter…

Maybe this help you.

2009/9/2 Richard Sweeney :> Hi,

I’m implementing joystick support for my game and it’s mostly working OK.
The problem I am experiencing at the moment is that if the joystick is
plugged in when the computer boots up, when I run the game the analogue
stick is read as pointing up and left, so it starts moving immediately.

If I tap any direction on the joystick then it stops moving and is all OK
with subsequent game restarts until the next time I reboot with the joystick
plugged in.

Is there anything I can do to stop this from happening or is this a problem
with the way the OS handles the joystick? I’m running Kubuntu Hardy 32bit.

Thanks

Richard


View your other email accounts from your Hotmail inbox. Add them now.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Ren? Dettenborn
Bacharel em Ci?ncia da Computa??o - UFT
+55 63 8411 9545 (SMS)
MSN: renedet at hotmail.com
GTalk: renedet
http://renedet.blogspot.com

Is this a USB joystick? Did you check the calibration in Ubuntu’s
config settings?

Jonny DOn Wed, Sep 2, 2009 at 5:15 AM, Richard Sweeney wrote:

Hi,

I’m implementing joystick support for my game and it’s mostly working OK.
The problem I am experiencing at the moment is that if the joystick is
plugged in when the computer boots up, when I run the game the analogue
stick is read as pointing up and left, so it starts moving immediately.

If I tap any direction on the joystick then it stops moving and is all OK
with subsequent game restarts until the next time I reboot with the joystick
plugged in.

Is there anything I can do to stop this from happening or is this a problem
with the way the OS handles the joystick? I’m running Kubuntu Hardy 32bit.

Thanks

Richard


View your other email accounts from your Hotmail inbox. Add them now.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

OK, I’ll have a look at this. Thanks for your help!> From: grimfang4 at gmail.com

Date: Wed, 2 Sep 2009 15:15:43 -0400
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Analogue Joysticks and Linux

Is this a USB joystick? Did you check the calibration in Ubuntu’s
config settings?

Jonny D

On Wed, Sep 2, 2009 at 5:15 AM, Richard Sweeney<@Richard_Sweeney> wrote:

Hi,

I’m implementing joystick support for my game and it’s mostly working OK.
The problem I am experiencing at the moment is that if the joystick is
plugged in when the computer boots up, when I run the game the analogue
stick is read as pointing up and left, so it starts moving immediately.

If I tap any direction on the joystick then it stops moving and is all OK
with subsequent game restarts until the next time I reboot with the joystick
plugged in.

Is there anything I can do to stop this from happening or is this a problem
with the way the OS handles the joystick? I’m running Kubuntu Hardy 32bit.

Thanks

Richard


View your other email accounts from your Hotmail inbox. Add them now.


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


Access your other email accounts and manage all your email from one place.
http://clk.atdmt.com/UKM/go/167688463/direct/01/