-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Incorrect ButtonIndex in Xbox controller and MacOS #68976
Comments
I see normal button presses with a Switch Pro controller on macOS 13, so I suspect the issue is with one particular controller mapping. |
Mouse wheel up returns |
@avilches Can you test using GDScript? Or add a MRP that uses GDScript? Just to be sure that the issue lies with Godot and not the C# bindings. |
Yes, it's a Godot problem. I've changed the code to GDScript like the screenshot and, after pressing A B X Y, it prints 0,1,3,4 instead of 0,1,2,3 |
It's likely a wrong mapping. Check this for steps on creating a controller mapping. It it fixes the issue, you should contribute it to the SDL_GameControllerDB |
The controller worked before in Godot 3.5. I tried with a Xbox One controller and Xbox Series S, both failed. Even the mouse wheel up returns MaskMiddle in MacOS too, so I guess it's a general configuration issue in Godot 4 only. |
|
I had to reopen it (I have different Xbox controllers, and some of them work, and others don't). I have one specific Xbox controller which is failing in Godot 3.5.1 (this is the original one I was using when I opened this issue in the first place). Now, if use this new environment variable
Then the X,Y are fixed, but the dpad doesn't work. |
Does this issue also happen when you connect the controller with a cable? And just to confirm, this issue is present on both 4.0 and 3.5.1? |
I'm confused by @avilches's conflicting reports here, based on all the above it looks like the hat mapping for dpad aren't working, but they may have resolved that issue somehow on their end per mdqinc/SDL_GameControllerDB#660 (comment) ? I've merged the mapping submitted for |
The controller only works by bluetooh, I've tried with a microUSB to USBc conector with no success. I've tried with the godot-demo-projects/misc/Joypads app (branch 4.0-dev) with Godot 4 beta 11, and same behaviour |
Sorry @offalynne and thanks for your time. I have two different controllers:
|
So if I understand correctly this issue is fixed? We might just need to update our copy of SDL_GameControllerDB? |
Partially. The left digital pad is still not working well even with the patches: you press down and Godot shows down+left... If you update your copy from SDL_GameControllerDB just close this issue, and I will check again in the next version, opening an issue if it's still needed. |
We've updated the database multiple times since this report. It's worth checking if Godot 4.2 still shows the same issue or not. But it's likely an upstream problem, if I understand correctly? I guess we can close it and see any new reports happen. |
Observing incorrect button mappings on macOS 14.2.1 with an Xbox One X controller and Godot 4.2.1. |
The Xbox Controller buttons are messed up on my Elite Series 2 Xbox Controller. I upgraded to The Event Configuration mostly works (details below), but for some reason there's a disconnect between that menu and the actual input grabbed from the running game. The following are the results of my testing between Godot and the online Gamepad Tester (hardwaretester.com) and I'm using this documentation for the names of XBox buttons: TestingGodotEvent Configuration MenuNot Working Correctly
Actual Running GameTo test this, in the Project Settings, I mapped every registered button to an action of its same name (using the auto-detect in Godot with a controller press) and then started the game and just started clicking those same buttons var all_buttons = [
'A-Button',
'B-Button',
'X-Button',
'Y-Button',
'RB-Button',
'LB-Button',
'Menu-Button',
'View-Button',
'DPad-Up-Button',
'DPad-Right-Button',
'DPad-Down-Button',
'DPad-Left-Button',
'Profile-Button',
]
func _process(delta):
for button in all_buttons:
if Input.is_action_just_pressed(button):
print(button + ' just pressed') Not Working CorrectlyWhen the game starts, the game registers DPad-Up and Profile buttons being pressed automatically.
Working
Gamepad Tester (hardwaretester.com)I only put this here as evidence that my controller doesn't have problems. Everything working except what's not on their UI, which is to be expected. Not Working Correctly
WorkingI only provide this in the event their mappings (i.e. B5, B4, etc) are helpful.
Haha after all this testing, would love to find out this is a me (or my hardware) problem. But crossing my fingers that this may also be helpful to understanding this issue. Update ** I removed the issues with the paddle buttons as those get re-mapped and when I was pressing the Profile button it was messing with the test. Also, I have an 8BitDO SN30 pro+ controller that I ran these same tests with and it works perfectly fine. |
I can confirm, I ran into a similar problem with my Elite v2. x button did not register for me, but I found out that if I check for the Y button being pressed, that actually works when I press X. |
Apologies: I'm new here. Not sure if I should revive a closed thread or make a new one, but I'm definitely still getting this incorrect mapping behavior with an Xbox One controller on MacOS 14 with Godot 4.3dev3. For example: I create a new empty project, go to Project Settings > Input Map, and create an Action. Then when I press what should be the Start button (Xbox Menu) on my controller, it reads as D-pad Up, as shown in the image. If I press the left bumper, that reads as the Start button. |
I can report same behaviour @jplewe describes on godot 4.2.1 MacOs |
I can confirm that #80709 fixes the issue for me |
Still seeing this issue on Godot 4.3. Same exact issue, even down to "start" being mapped to the left shoulder button. Currently running Godot 4.3 for Linux, without .Net, using an Xbox One Controller. |
Godot version
v4.0.beta5.mono.official.89a33d28f
System information
Macos Monterey 12.6
Issue description
InputEventJoypadButton.ButtonIndex
return incorrect values for buttons.All the buttons return wrong codes, except A(0) and B(1), where it returns the right ButtonIndex.
Screen.Recording.2022-11-21.at.23.02.17.mov
Steps to reproduce
This snippet is enough to see the buttons and check if they are correct or wrong:
Minimal reproduction project
wrong-button-index-xbox-controller-on-mac.zip
The text was updated successfully, but these errors were encountered: