- GameControlLabel: RichTextLabel-based custom node with a ControlKey enum (24 device keys plus CUSTOM) and a separate instruction string. Uses BBCode [font] tag to scope the prompt font to the glyph so the instruction inherits the parent theme. Connects to GdControlsManager device_changed and refreshes on device swap; tool-mode safe. - install.py: idempotent merger that writes input actions from key_mapping/names.csv into project.godot's [input] section, preserving non-managed actions. - manager.gd: device_changed signal now carries only the device mode (was a four-tuple of category/type/id/name). Removed the class_name GdControlsManager declaration that collided with the autoload registration. Fixed UNKOWN -> UNKNOWN and _notifify_device_change -> _notify_device_change typos. - README: install and prompt-font regeneration instructions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| fonts/promptfont | ||
| key_mapping | ||
| src | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| install.py | ||
| plugin.cfg | ||
| plugin.gd | ||
| plugin.gd.uid | ||
README.md
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.