Daniel SamsonandClaude Opus 4.7 501e49cc20 add GameControlLabel, install.py, manager fixes
- 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>
2026-04-29 00:09:07 +01:00

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

  1. Drop this addon into your project under addons/gd-controls/ (clone, copy, or add as a submodule).
  2. Enable the plugin: Project → Project Settings → Plugins → gd-controls → Enable.
  3. Install the standard input actions into project.godot:
    python3 addons/gd-controls/install.py
    
    This reads key_mapping/names.csv and 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 edit names.csv.
  4. 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.

S
Description
No description provided
Readme
1.1 MiB
Languages
JavaScript 62.4%
HTML 27.2%
GDScript 9%
Python 0.9%
CSS 0.5%