macOS with Xbox One S Controller D-Pad not working properly

Hi,

I have issues with getting my Xbox One S Controller working properly with bluetooth. The problem occurs when I try to map the buttons. I can map all the buttons but the D-pad behaves funky. If I assign the D-pad the following happens: “User 1 Up D-pad” -> “Hat #0 right (N/A)” “User 1 Down D-pad” -> “Hat #0 down (N/A)” “User 1 Left D-pad” -> “Hat #0 left (N/A)” “User 1 Right D-pad” -> “Hat #0 down (N/A)”

Afterwards I can move up, down and left. I cannot move to the right. When pressing right it moves up.

The controller is working fine with Retroarch on Android. Also a joypad tester (Controllers Lite) shows all buttons working on macOS.

I already tried to tamper with retroarch.cfg but could not get it working. (The menue was scrolling automatically all the time.)

If more information is necessary please let me know and I will be happy to provide it.

Cheers soe

I will answer my own question. There seems to be bug in the IOKit related code. If I add a val–; at the following line: https://github.com/libretro/RetroArch/blob/d9f4675a5104e321b1d806363abe7fd6edef92c8/input/drivers_hid/iohidmanager_hid.c#L298 everything seems to be working fine.

Without the val-- the default val if nothing is pressed is 0 for the XBox controller but the code takes this as “Up”.