Skip to content

Input Actions Configuration

Status: Draft

The plugin integrates with Godot’s standard InputMap system. GBActions is a simple resource containing editable action names that correspond to the input mappings configured in Godot’s project settings.

Refactored in v5.0.0: Action names consolidated from scattered locations into centralized GBActions resource.

There is no custom input system - the plugin simply responds to standard Godot input events through the InputMap. GBActions provides a centralized location for these action name strings, making them easier to manage and customize.

GBActions is not a system - it’s a simple configuration resource containing:

  • String constants for action names (e.g., "gb_select", "gb_rotate")
  • Editable properties that can be customized per project
  • Centralized location for all input action names used by the plugin
  • Mapping to Godot’s InputMap configured in Project Settings → Input Map
  1. Plugin User Setup: In Godot’s Project Settings → Input Map, the user defines input actions
  2. GBActions Resource: Contains string names matching the InputMap action names
  3. Systems Integration: ManipulationSystem and PlaceableSelectionUI read from GBActions to know which input actions to listen for
  4. Standard Godot Input: All input handling uses Godot’s built-in Input.is_action_pressed(), etc.
  • Centralized Action Names: Action name strings refactored from scattered locations (BuildingSystem, ManipulationSystem) into GBActions resource
  • Easier Customization: All input action names in one location for project-specific customization
  • Better Organization: Clear separation between plugin action names and project input configuration
  • GBActions Resource: Refactored (not new) - consolidates action name strings previously scattered across multiple systems
  • Editable Action Names: Each action name is an exported property that can be customized
  • Project Integration: Seamless integration with Godot’s standard InputMap system
  • Building Actions: Core building mode controls (gb_select, gb_cancel, gb_rotate)
  • Manipulation Actions: Move, rotate, flip, and demolish controls
  • Navigation Actions: Grid targeting and camera controls
  • UI Actions: User interface interaction controls
  • Action Name Validation: Easier to debug input issues with centralized action names
  • Project Customization: Clear documentation of which actions need InputMap configuration
  • Consistency Checking: All systems use the same action name references
Action NameDefault Binding (Example)Purpose
gb_selectLeft Mouse ButtonPick placeable / confirm placement
gb_cancelRight Mouse Button / EscCancel preview / exit mode
gb_rotateR key / Mouse Wheel ClickRotate active preview
gb_cycle_variant_nextE / Mouse Wheel UpNext variant in sequence
gb_cycle_variant_prevQ / Mouse Wheel DownPrevious variant
gb_toggle_modeTabCycle build modes (build / demolish / inspect)
gb_multi_place_toggleMEnable/disable multi‑place session

(Adapt these to actual project actions if already defined.)

In Godot’s Project Settings → Input Map, add these actions:

  • gb_select → Left Mouse Button
  • gb_cancel → Right Mouse Button / Escape
  • gb_rotate → R key
  • etc.

Edit the GBActions resource to change action names if needed:

@export var select_action: String = "my_custom_select" # Instead of "gb_select"
  • ManipulationSystem: Reads from GBActions to know which input actions to listen for
  • PlaceableSelectionUI: Uses these action names for build mode initiation
  • All input handling: Uses standard Godot Input.is_action_pressed(actions.select_action)

Flow: Raw Input Event → Godot InputMap → GBActions ResourceManipulationSystem → State Update → UI/Visual Feedback

  • No custom input system - pure Godot InputMap integration
  • GBActions is just a string container - editable action name references
  • Systems read action names from GBActions resource at runtime
  • Plugin user configures the actual key bindings in Godot’s InputMap
  1. Input event received through Godot’s standard input system
  2. Systems check Input.is_action_pressed(GBActions.select_action)
  3. ManipulationSystem processes the input and updates state
  4. UI updates automatically through signals

During preview:

  • Confirm suppressed if can_place false
  • Rotate / variant cycling allowed even when invalid
  • Cancel always available

If enabled, after a successful placement the preview remains active; selection persists. Exiting requires explicit cancel or mode switch.

Variant cycling supports both dedicated keys and mouse wheel for rapid iteration. Ensure the InputMap binds both for accessibility.

Invalid actions (e.g. confirm when invalid) should produce subtle feedback:

  • Flash invalid indicator color
  • Optional tooltip / message via GBMessages
  • Manipulation System: systems/manipulation_system.md
  • Configuration & Settings (Actions list resource): systems/configuration_and_settings.md
  • Placeable Selection UI: systems/placeable_selection_ui.md

Community & Purchase Hub: Linktree – All Grid Builder Links