We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3170 - Rest state for Joystick button bound to controller trigger is never translated
Summary: Rest state for Joystick button bound to controller trigger is never translated
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-09 17:27 UTC by Leonard Ritter
Modified: 2015-11-09 19:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonard Ritter 2015-11-09 17:27:48 UTC
I configured an older gamepad for the controller interface today, using the controllermap tool (i also tried the Steam big picture mapper for comparison).

The resulting binding is

03000000a306000020f6000011010000,PS2700 Rumble Pad,platform:Linux,x:b0,a:b1,b:b2,y:b3,back:b8,guide:b12,start:b9,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,

The PS2700 is generally structured after an XBOX Controller (but can also be transitioned into an alternate PS2 mode). Apparently either this gamepad, or the driver for it, reports its triggers as buttons.

Observed behavior:

As the mapping shows, SDL correctly maps the lefttrigger and righttrigger to b6 and b7, but only translates them to CONTROLLERAXISMOTION events when the trigger is pulled; That is

event: SDL_JOYBUTTONDOWN
 which: 0
 button: 7
 state: 1

is, as expected, mirrored to

event: SDL_CONTROLLERAXISMOTION
 which: 0
 axis: 4
 value: 32767

but the release event

event: SDL_JOYBUTTONUP
 which: 0
 button: 7
 state: 0

has no equivalent mirrored controller event.

This trips up games that measure trigger deltas, and they all do. As it is, I can't use this gamepad's trigger buttons in controller mode.

Expected behavior:

The event SDL_JOYBUTTONUP for a button mapped to a controller trigger is translated into a corresponding SDL_CONTROLLERAXISMOTION event with value 0.
Comment 1 Leonard Ritter 2015-11-09 19:05:35 UTC
Nevermind. I'm an idiot. There is no problem with SDL. The bug was in my test app.