Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axis 0 (left stick x) always returns 0. testjoystick patch #568

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Axis 0 (left stick x) always returns 0. testjoystick patch #568

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 2.0.0
Reported for operating system, platform: Linux, x86_64

Comments on the original bug report:

On 2012-03-30 09:58:01 +0000, jordirovira wrote:

Created attachment 840
Fix to update the joystick test to 2.0

Using linux and PS3 controller. In SDL 1.2 it used to work fine.
The axis 0 corresponding to X in the left stick always returns 0. The rest of the axis seem to work fine.

To reproduce, i have updated the testjoystick.c program in SDL/test to work with 2.0 (See patch). You can see that the right stick works, and the left stick works for the vertical axis only.

On 2012-04-20 03:33:56 +0000, jordirovira wrote:

I think i have located the problem: The joystick system is constantly receiving events of the type ABS_MT_WIDTH_MAJOR (related to multitouch?) for the PS3 pad. This events get incorrectly mapped to axis 0 events in a switch at SDL_sysjoystick.c.

The problem is in the default branch of the switch at line 1133, which is executed for all events but ABS_HATxx.

Not beeing a joystick expert, i have solved it for now, by adding some extra case filtering like this:

//jordi
// default:
case ABS_X:
case ABS_Y:
case ABS_Z:
case ABS_RX:
case ABS_RY:
case ABS_RZ:
case ABS_THROTTLE:
case ABS_RUDDER:
case ABS_WHEEL:
case ABS_GAS:
case ABS_BRAKE:
events[i].value =
EV_AxisCorrect(joystick, code, events[i].value);
#ifndef NO_LOGICAL_JOYSTICKS
if (!LogicalJoystickAxis(joystick,
joystick->hwdata->abs_map[code],
events[i].value))
#endif
SDL_PrivateJoystickAxis(joystick,
joystick->
hwdata->abs_map[code],
events[i].value);
break;

            default:
                break;

I am not really sure if the gas, rudder, wheel, etc should be axis though.

On 2012-06-11 07:45:01 +0000, wrote:

We are going to apply this patch in Debian, created by one of the maintainers of the package, to try to fix it:

http://anonscm.debian.org/gitweb/?p=pkg-sdl/packages/libsdl1.2.git;a=blob;f=debian/patches/fix_joystick_misc_axes.diff;h=75e3755c93c83965a76c9f0541205855b3b8a27b;hb=856a810b8cd61fb371163a480a96c7f6c3e461a4

Cheers.

On 2012-06-11 07:45:49 +0000, wrote:

Created attachment 875
fix_joystick_misc_axes.diff

On 2013-07-12 11:43:11 +0000, Ryan C. Gordon wrote:

I think we fixed this awhile ago, separate from this patch. I'll confirm.

--ryan.

On 2013-07-12 18:52:54 +0000, Ryan C. Gordon wrote:

(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.)

Tagging a bunch of bugs as target-2.0.0, Priority 1.

This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible.

That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship.

Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment.

Thanks!
--ryan.

On 2013-07-15 01:37:00 +0000, Ryan C. Gordon wrote:

I think this is the change we made to deal with axis zero being overwritten incorrectly...

http://hg.libsdl.org/SDL/rev/57001e845b72

...I'm trying to understand how the Debian patch fixes this...is this mapping some extra, bogus axes to the controller? (or maybe the PS3 controller's tilt sensors are showing up as an axis now?).

--ryan.

On 2013-07-30 00:26:00 +0000, Ryan C. Gordon wrote:

(In reply to comment # 6)

...I'm trying to understand how the Debian patch fixes this...is this
mapping some extra, bogus axes to the controller? (or maybe the PS3
controller's tilt sensors are showing up as an axis now?).

I'm closing this as FIXED for now, because the existing code fixed this specific bug report at some point.

We'll probably be revamping the joystick code a little bit going forward, since we want to deal with non-standard things better (Wiimote things, Guitar Hero things, etc), and will look at the PS3 controller tilt sensors then.

--ryan.

On 2013-10-20 19:26:43 +0000, Ryan C. Gordon wrote:

*** Bug 2165 has been marked as a duplicate of this bug. ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant