Comments (2)
Is there a way to make the settings menu navigable with just the keyboard? So users can use either the mouse or the keyboard.
I know GGS isn't responsible for the configuration of the Settings-Menu, so maybe setting Focus on those items isn't an issue for this package?
The menu should be keyboard navigatable already, thanks to Godot itself. You just gotta handle the focus.
If you want your menu to be navigatable by keyboard, first, you gotta make sure that you have keys assigned to ui_left/right/top/bottom
actions in the Input Map. After that, you just need a script that handles focusing on a node when the player enters the settings menu.
For example, let's say you want the focus to be on a node called "FullscreenToggleButton" when someone enters the options menu. So:
extends Control
onready var FirstFocus = $FullscreenToggleButton
func _onready():
FirstFocus.grab_focus()
That allows the users to navigate the menu using the keyboard. Without doing that, they won't be able to do it because no node has focus to begin with. From there on, you can handle focus targets using the "Focus" section in the Inspector (Neighbour Left, Neighbour Right, etc.).
If you want the nodes to be controllable only with the keyboard, you can set their mouse_filter
property to Ignore
. Check the "Mouse" section in the Inspector.
Maybe I could add functionality to the components' scripts to handle is_focus() cases. The ggs_arrow_list would definitely need to handle that implicitly in order to call "press" on its children buttons
The components do require a simple change to handle the focus properly when the mouse is hovered over them. Right now, when you hover over a component with a mouse, it doesn't technically gain focus.
connect("mouse_entered", self, "_on_mouse_entered")
func _on_mouse_entered():
grab_focus()
That's basically all there is to it. I'll go ahead and push the fix in a moment.
Hopefully that helped you achieve what you wanted to do.
from godot-game-settings.
Maybe I could add functionality to the components' scripts to handle is_focus() cases. The ggs_arrow_list would definitely need to handle that implicitly in order to call "press" on its children buttons
from godot-game-settings.
Related Issues (20)
- Godot 4 version HOT 7
- Adding new properties crashes the addon HOT 3
- Crash when add category HOT 1
- Window moves to secondary monitor when changing resolution HOT 3
- Cannot remap inputs to arrow keys HOT 6
- Mouse with more than 5 buttons can index outside the expected array HOT 1
- Wrong Links on wiki HomePage HOT 1
- File tree walking HOT 2
- Trouble exporting (fail to write, file in use, locked or lacking permissions) HOT 2
- Settings Panel does not work properly at first in Godot 4.1 HOT 2
- Can't find link or repository to the 3.x version HOT 2
- item_order not getting set HOT 1
- plugin_data.tres not cleaning out "deleted" settings
- Window Size Setting Sizes don't get shown in lists HOT 2
- Change main branch for addon files only and add branch for addon
- Upgrading existing project from GGS 3.0 to 3.1? HOT 2
- Receive error on add category HOT 1
- Documentation Feedback HOT 1
- godot 4.2 beta4 have a error
- Slider can override setting value hint string range
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-game-settings.