Input
Input is handled by RetroHub first, then passed onto the theme. This is to ensure input works properly if an app menu is open, as well as fix some issues regarding controller input.
Input actions
Your theme should ideally only use input actions to ensure full compatibility, which also letting users easily remap controls to their liking. The following input actions are available:
Action |
Description |
Default keys |
---|---|---|
rh_up |
Move up |
|
rh_down |
Move down |
|
rh_left |
Move left |
|
rh_right |
Move right |
|
rh_accept |
Accept a given action |
|
rh_back |
Cancel a given action |
|
rh_major_option |
Major/frequent option |
|
rh_minor_option |
Minor/rare option |
|
rh_theme_menu |
Open the theme menu |
|
rh_left_shoulder |
Slide left |
|
rh_right_shoulder |
Slide right |
|
rh_left_trigger |
Trigger left |
|
rh_right_trigger |
Trigger right |
|
rh_rstick_left |
Move the right stick left |
|
rh_rstick_right |
Move the right stick right |
|
rh_rstick_up |
Move the right stick up |
|
rh_rstick_down |
Move the right stick down |
|
Input Icons
RetroHub uses Controller Icons to show appropriate icons for each input method. This addon automatically switches icons between keyboard/mouse and controllers, so use it to display how to perform a given action in your theme. Here’s a quick guide to get started.
Controllers and UI
Ideally your theme is fully usable with a controller, without requiring any keyboard/mouse input. If you use Godot’s builtin UI nodes, you need to ensure that these nodes receive focus, and that their focus neighbors are set as well. Here are a few more tips:
Godot will rarely set a node as focused on the first frame. Call
grab_focus
on_ready()
to ensure there’s always a focused node.Controls that require keyboard input, such as
LineEdit
,TextEdit
andSpinBox
are automatically handled by RetroHub. If you need the virtual keyboard for another type of node, you can manually callRetroHubUI.show_virtual_keyboard()
. More information on the UI section and in the RetroHubUI class reference.
Note
To design a theme for controllers without having one available, ensure you can use your theme with only the keyboard, and that you never have to use the mouse to access some part of your theme.