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

Add buttonmap for DualShock4 connecting to macOS via BT. #189

Merged
merged 1 commit into from
May 7, 2021
Merged

Add buttonmap for DualShock4 connecting to macOS via BT. #189

merged 1 commit into from
May 7, 2021

Conversation

nickolay
Copy link

@nickolay nickolay commented May 6, 2021

Tested using DualShock 4 (2nd gen) controller connected via bluetooth to a Macbook running macOS 11.2.3.

It advertises itself as "DUALSHOCK 4 Wireless Controller", axes: 6, hats: 0, buttons: 14, not as "Wireless Controller" specified in the existing button map.

So even though the vid/pid and the rest are the same, the existing button map is not used.

As Joystick families (#32) do not seem to be fully implemented (adding a new entry to the joystickfamilies.xml didn't have an effect and I don't see where it's used in the code), I solve this by duplicating the existing button map with a different name.

Tested using DualShock 4 (2nd gen) controller connected via bluetooth
to a Macbook running macOS 11.2.3. It advertises itself as
`"DUALSHOCK 4 Wireless Controller", axes: 6, hats: 0, buttons: 14`,
not as "Wireless Controller" specified in the existing button map

https://github.com/xbmc/peripheral.joystick/blob/79d166a1519305f05ebf2db24a7fbd6bb7633083/peripheral.joystick/resources/buttonmaps/xml/cocoa/Wireless_Controller_v054C_p09CC_14b_6a.xml

So even though the vid/pid and the rest are the same, the existing
button map is not used per
https://github.com/xbmc/peripheral.joystick/blob/79d166a1519305f05ebf2db24a7fbd6bb7633083/src/storage/Device.cpp#L34

As Joystick families (#32) do not seem to be fully implemented
(adding a new entry to the joystickfamilies.xml didn't have an effect
and I don't see where it's used in the code), I solve this by
duplicating the existing button map with a different name.
@garbear
Copy link
Member

garbear commented May 7, 2021

Thanks! Until joystick families are implemented, the intention is to have a new XML file for every driver name, because XML is relatively cheap for now. There are many improvements we could make to further the vision of intelligently mapping unseen controllers. Joystick families sprung up entirely as a way to re-use any data we could from the old buttonmaps before the new joystick system in v17.

@garbear garbear merged commit f85af3f into xbmc:Matrix May 7, 2021
@nickolay nickolay deleted the ds4-bt-cocoa branch May 7, 2021 05:33
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.

2 participants