joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.54k stars 373 forks source link

XBox 360 Controller - hat not detected #2335

Open Banjo-Oz opened 3 years ago

Banjo-Oz commented 3 years ago

My USB XBox 360 controller doesn't register presses of the d-pad (i.e. the "hat" buttons) in DOSBox-X.

In the mapper, the hat directions are greyed out and do not "flash" when the d-pad is pressed.

Also, if I try to map any keyboard key to the d-pad, nothing happens. The d-pad keypress is ignored, unlike any other controller button which can be assigned as normal.

Manually editing a .map file (in a text editor) to assign the hat buttons doesn't make them work either.

This is not the case in DOSBox Staging, ECE or vanilla DOSbox, where the same controller's hat/d-pad registers button presses and all can be freely mapped in the mapper.

In all test cases, I set joysticktype=fcs

Wengier commented 3 years ago

@Banjo-Oz Have you tried setting joysticktype=auto instead of joysticktype=fcs? I don't have XBox 360 controller myself, but I do have XBox One controller and Logitech Dual Action gamepad to test, and with the setting joysticktype=auto the D-Pad of both controllers will indeed work. In DOSBox ECE (latest version r4441) I believe I got the exact same result.

Banjo-Oz commented 3 years ago

@Wengier changing it to "auto" does indeed fix the issue in DOSBox-X, though it requires a reboot/refresh (i.e. using "config -set joystick joysticktype=auto" doesn't work, but that is likely expected since it's hardware?). Thanks!

EDIT: while researching this issue, I came across this. Out of interest, does DOXBox-X include this patch or something similar for using 2 xbox controllers? I don't have two to test with, but I know ECE includes the patch and was curious.

Wengier commented 3 years ago

@Banjo-Oz I believe the linked patch is already included in DOSBox-X. On the other hand, the issue with the settings fcs is independent of the linked patch, and I think it is fixed as part of #2347.

You can download the updated Windows binary package here:

Banjo-Oz commented 3 years ago

@Wengier The fcs issue with my 360 controller is now fixed when I use the build in that download! :)