1.4 KiB
1.4 KiB
gd-controls
Standardize game controls framework
- Input detection for keyboard/mouse, PC/XBox/Playstation/Nintendo controller
- Custom GameControlLabel that changes the symbols based on the input detection
Default Mapping
gd-controls comes with a default mapping and mapping to the promptfont icon font set.
Install
- Drop this addon into your project under
addons/gd-controls/(clone, copy, or add as a submodule). - Enable the plugin: Project → Project Settings → Plugins → gd-controls → Enable.
- Install the standard input actions into
project.godot:
This readspython3 addons/gd-controls/install.pykey_mapping/names.csvand adds one Godot input action per row to the[input]section. Existing actions whose names don't match a CSV row are preserved; same-named actions are overwritten. Re-run the script any time you editnames.csv. - Reopen the project in Godot so it picks up the new input actions and the prompt-font resources.
Requires Python 3.9+ for install.py.
Regenerating the prompt-font mapping
src/prompt_font_mapping.gd is generated from key_mapping/promptfont.csv. After editing the CSV, run:
python3 addons/gd-controls/src/gen.py
The generator splices its output between the # === STARTGEN === / # === ENDGEN === markers in the .gd file; the surrounding scaffolding is left intact.