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

PopupMenu issue with navigating Items with a joystick #42230

Closed
meloonics opened this issue Sep 21, 2020 · 4 comments · Fixed by #80271
Closed

PopupMenu issue with navigating Items with a joystick #42230

meloonics opened this issue Sep 21, 2020 · 4 comments · Fixed by #80271

Comments

@meloonics
Copy link

Godot version: 3.2.2

OS/device including version: Windows 10 Pro 64bit

Issue description:
When trying to navigate the PopupMenu inside an OptionsButton with the Joystick of an Xbox One-Controller, the focus changes every tick, which makes it hard to select specific items. Navigating other Control Nodes such as Buttons is not an issue at all, the Input gets detected correctly, not once per tick. Increasing the Deadzone of the Joystick seems to do nothing, the PopupMenu seems to ignore deadzone altogether. There is no possible workaround in code, as far as I know, since there is no method to manually focus an Item inside a PopupMenu (at least according to the docs: https://docs.godotengine.org/en/3.2/classes/class_popupmenu.html). Maybe I just can't figure it out.
A video of the issue can be found at the following reddit-post:
https://www.reddit.com/r/godot/comments/ix02eb/weird_scrolling_issue_with_optionbutton_and/

Steps to reproduce:
Create a Scene with an OptionsButton. In code, add a couple of Items to the OptionsButton and make it grab_focus() in the _ready()-method. Next, open the InputMap via ProjectSettings and add a new JoyAxis to ui_up/down/left/right, A-Button to ui_accept and B-Button to ui_cancel.
Run the Project with an Xbox One-Controller connected (I don't know if the issue is specific to xbox one, though). Try selecting Items inside the OButton, using only the Joystick, not the D-Pad or arrow keys.
You will notice, that the focus only moves downwards in the list, even if you tilt the joystick upwards. The focus seems to change per tick. In comparison, navigating the submenu with the D-pad or arrow keys seems to work as intended.

Minimal reproduction project:

optionbutton_issue.zip

I'd be happy to at least find a workaround for this issue for now, since using the D-pad is not an option for my project.

@Calinou
Copy link
Member

Calinou commented Sep 21, 2020

I guess the same approach as #31880 needs to be applied to PopupMenus. cc @pouleyKetchoupp

@pouleyKetchoupp
Copy link
Contributor

Yes, it looks like it's the same issue and applying the logic from #31880 would be an improvement.

Properly handling key/joystick repeat to navigate ui smoothly is missing as well (for both focus changes and popup menus).

@meloonics
Copy link
Author

is there some kind of workaround for this issue?
I lack the skills to fix the engine myself, but maybe i can do something in the current version, when someone points out the general direction

@Calinou
Copy link
Member

Calinou commented Sep 26, 2020

@meloonics I'm afraid there's no way to fix this without modifying the engine code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants