You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
UI in a game, trying to get simultaneous mouse and controller support.
Describe the problem or limitation you are having in your project
Godot_v4.4-beta3_win64_ZNFMCRYvnr.mp4
I made it so hovering over buttons immediately grabs their focus, as this seems like the most intuitive way to handle mouse + controller menu support (this also makes UI audio much easier to work with).
I have the following setup. The buttons are empty with white font when not focused, and white with black font when focused.
However the issue with the combination of these setups is that mouse hover effects take priority over focus effects, so I had to make it so the hover font color is black. But that creates another issue where if you focus a button using the controller/keyboard while the mouse is still hovering another button, the font stays black until you move your mouse off the button. This is where I got completely stuck.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
This has potentially many solutions, from adding an ability to disable hover effects (since they just get in the way in my case) or change their priority. But in this case the simplest solution would just be to add font_hover_focus_color to relevant controls.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add font_hover_focus_color. It dictates the font color when a button is BOTH focused and hovered over.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I cannot find a way to work around this.
Is there a reason why this should be core and not an add-on in the asset library?
Requires updating built-in classes to support.
The text was updated successfully, but these errors were encountered:
I made it so hovering over buttons immediately grabs their focus, as this seems like the most intuitive way to handle mouse + controller menu support (this also makes UI audio much easier to work with).
This is not how UI focus is meant to work. Focus does not follow the mouse in modern operating systems; instead, it's dictated by clicking.
Something like #10221 is better suited to addressing this problem, although I think it should only be a visual change and not affect the actual focus behavior, like :focus-visible in CSS.
Calinou
changed the title
Add font_focus_hovered_color
Add a font_focus_hovered_color theme item to BaseButton
Feb 17, 2025
Describe the project you are working on
UI in a game, trying to get simultaneous mouse and controller support.
Describe the problem or limitation you are having in your project
Godot_v4.4-beta3_win64_ZNFMCRYvnr.mp4
I made it so hovering over buttons immediately grabs their focus, as this seems like the most intuitive way to handle mouse + controller menu support (this also makes UI audio much easier to work with).
I have the following setup. The buttons are empty with white font when not focused, and white with black font when focused.
However the issue with the combination of these setups is that mouse hover effects take priority over focus effects, so I had to make it so the hover font color is black. But that creates another issue where if you focus a button using the controller/keyboard while the mouse is still hovering another button, the font stays black until you move your mouse off the button. This is where I got completely stuck.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
This has potentially many solutions, from adding an ability to disable hover effects (since they just get in the way in my case) or change their priority. But in this case the simplest solution would just be to add
font_hover_focus_color
to relevant controls.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Add
font_hover_focus_color
. It dictates the font color when a button is BOTH focused and hovered over.If this enhancement will not be used often, can it be worked around with a few lines of script?
I cannot find a way to work around this.
Is there a reason why this should be core and not an add-on in the asset library?
Requires updating built-in classes to support.
The text was updated successfully, but these errors were encountered: