gdx-controllers icon indicating copy to clipboard operation
gdx-controllers copied to clipboard

Mapping doesn't include LT and RT axis

Open klianc09 opened this issue 2 years ago • 2 comments

The getMapping() is pretty useful, but it only includes any buttons that might be mapped to L2/R2, but for those gamepads that have triggers the mapping should also include the axis for both the left and right trigger (LT/RT).

At least on desktop the trigger seem to be properly mapped to their axis. So instead of using the mapping I've currently just hardcoded LT to axis 4 and RT to axis 5.

If it's difficult to determine what's the axis on other platforms, maybe those would just have -1 in there until someone implements it.

klianc09 avatar May 31 '23 09:05 klianc09

IIRC the buttons are mapped to buttons on all other platforms, but I might remember wrong. I am open for all good suggestions but someone has to take a look on all the platforms for this. :)

MrStahlfelge avatar Jun 01 '23 08:06 MrStahlfelge

I was testing with a bluetooth controller on android and to my surprise the trigger was mapped to both an axis and a button. So could be the case that on the other platforms the trigger is always mapped to a button. Which would make desktop the odd one out.

IDK, I handle desktop as an edge case at the moment, which would be cool to not be necessary, but it's not such a big deal to be worth much effort. I guess at least this issue can act as a documentation of this quirk for now.

klianc09 avatar Jun 01 '23 09:06 klianc09