Skip to content

Conversation

@connorjclark
Copy link
Contributor

@connorjclark connorjclark commented Aug 26, 2023

As referenced here: #1462 (comment)

This patch fixes detection of the secondary thumbstick. I tested on two devices: a PS4 Dualshock, and a Stadia controller.

The code assumed that Rx, Ry, Rz will always be what maps to the secondary stick. However, that apparently was too hard for controller manufacturers to do. For example, my above mentioned controllers use Z and Rz for the second stick. Short of including a database of controller mappings, this patch introduces a heuristic to guess how to map to a secondary stick.

The idea for the solution came from https://www.gamedev.net/forums/topic/613913-directinput-identifying-second-thumbstick/

happens to fix #1700

@connorjclark
Copy link
Contributor Author

connorjclark commented Dec 9, 2025

I've updated the PR.

Disclaimer: I've absolutely no real experience or knowledge of DirectInput. All I know for sure is that this patch makes my Stadia controller (and some others I have) correctly detect the second stick. Also, I've been shipping this in https://github.com/ZQuestClassic/ZQuestClassic/ for a couple years now and haven't heard any issues. But I highly recommend asking someone with more experience w/ DirectInput to double check this.

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

Successfully merging this pull request may close these issues.

8bitdo micro on Windows does not display as a gamepad using al_set_joystick_mappings (directx)

2 participants