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

UI focus change is triggered too often when using gamepad analog stick to navigate menus (does not occur with D-pad or keyboard) #54959

Closed
rick551a opened this issue Nov 14, 2021 · 19 comments · Fixed by #59575

Comments

@rick551a
Copy link

rick551a commented Nov 14, 2021

Godot version

3.4 stable

System information

Windows10, Nvidia

Issue description

Navigating a menu with gamepad left stick axis is impossible using the default settings.

Cannot focus on controls in the usual manner.
I've encountered this on older versions too.

Steps to reproduce

1)Create a few contols on a 2D scene.

2)add gamepad left stick axis down to 'ui_down' & gamepad left stick axis up to 'ui_up' in Input under project settings

3)Try to navigate the controls using the left axis

4)Note you cannot focus like normal (like the way D-Pad works OK)

Minimal reproduction project

Small sample project: https://ufile.io/uqvtj8wq
Bugsquad edit: Re-uploaded to GitHub: GamepadFocusBug3_4.zip

Open project, run scene.

Click the first checkbox control with mouse.
Now try to use left stick axis on gamepad to navigate up and down the controls. Its impossible!

@Calinou
Copy link
Member

Calinou commented Nov 14, 2021

This was implemented by #31880, and it works in some projects I've developed such as https://github.com/Calinou/escape-space.

@rick551a
Copy link
Author

I just checked it on your game Escape space, the left stick navigation issue is here too.

See flv video of menu screen:
https://ufile.io/5875zngv

@Calinou
Copy link
Member

Calinou commented Nov 15, 2021

@Calinou Calinou changed the title Cannot focus on UI element when Gamepad stick axis used for navigation UI focus change is triggered too often when using gamepad analog stick to navigate menus (does not occur with D-pad or keyboard) Nov 15, 2021
@Calinou Calinou added this to the 3.4 milestone Nov 15, 2021
@pouleyKetchoupp
Copy link
Contributor

It's a regression in 3.4. It works fine in 3.3.4-stable, and the issue is already present in 3.4-beta1.

The next step to investigate is to do a git bisect between faf3f88 (3.3.4-stable) and 207fb16 (3.4-beta1) and test with a gamepad to figure out how it broke.

@pouleyKetchoupp
Copy link
Contributor

pouleyKetchoupp commented Nov 16, 2021

I'm adding a junior job tag for anybody who would be interested in investigating the issue (see my comment above).

Note that fixing the issue itself will probably be a bit involved and might not be a fit for junior job.

@Calinou
Copy link
Member

Calinou commented Nov 16, 2021

I'm looking into bisecting this issue.

Edit: I've bisected between faf3f88 (good) and 207fb16 (bad) and couldn't reproduce this in https://github.com/Calinou/escape-space with any of the commits… I'll let someone else do the bisecting.

@AlbeyAmakiir
Copy link

Is the current workaround to detect unhandled analogue stick events and handle their conversion to ui_direction actions manually?

@akien-mga
Copy link
Member

This is a regression from #44456, CC @univeous @KoBeWi @EricEzaM.

@univeous
Copy link
Contributor

Oh, that's actually my bad and I think I know how to fix it. Should I do it on master or 3.x? @akien-mga

Also, I don't know if this is off-topic. I said I can fix it which means I can make analog stick works as before( push stick and focus will move once, release it and push again to move focus again) while keyboard input will still work as my PR's purpose. But Having to push and release and push again to move focus in UI navigation is definitely annoying and a long-term issue(Since this problem is being fixed and regressed times, See #26853, #31880, #44456). Can we find a way to actually fix this?

#26825 is a related issue, I think it should be reopened.

@akien-mga
Copy link
Member

Should I do it on master or 3.x?

If the code is different, you can do two PRs, one for master and one for 3.x. Otherwise if the code didn't change you can do the PR only for master and I can cherry-pick it for 3.x (and 3.4).

#26825 is a related issue, I think it should be reopened.

This should be opened as a proposal on https://github.com/godotengine/godot-proposals. Adding a delayed echo system for joypad input in the UI can definitely be interesting but it would be more of a new feature/enhancement than a bugfix.

@univeous
Copy link
Contributor

Done for 3.x. Seems UI focus is broken in master, will do later.

@akien-mga
Copy link
Member

Fixed by #55480.

@Calinou
Copy link
Member

Calinou commented Dec 7, 2021

Reopening, as this issue is still present in master (#55480 was merged on 3.x).

@univeous
Copy link
Contributor

Done for 3.x. Seems UI focus is broken in master, will do later.

Maybe it's a little too later But #59575 ;)

@Vennnot
Copy link

Vennnot commented May 14, 2023

Is this missing from 4.0?

@ilookedeverywhere
Copy link

Hello, I believe this is happening in 4.0.3 stable. For me, it is happening using the D-pad and analog stick, but is not happening when using the keyboard.

@sketchyfun
Copy link
Contributor

This still seems to be an issue in v4.2 (custom build) [571cd0e]

@Calinou
Copy link
Member

Calinou commented Sep 22, 2023

Please continue the discussion in #35751 and #73241.

@TheDoorworlds
Copy link

This seems to be happening again in 3.6. What workarounds are available?

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

Successfully merging a pull request may close this issue.

10 participants