Skip to content

Wired

ss-gameforge-wired is a complete input management layer on top of Godot’s native input handling. It adds per-player input isolation, runtime rebinding with persistence, automatic device detection, and “press to join” support for local co-op.

Each player owns its devices and its own copy of every action, so in local co-op Player 1 on the keyboard and Player 2 on a pad never read each other’s input.

  1. Download ss-gameforge-wired from the releases page.
  2. Copy addons/ss-gameforge-wired/ into your project’s res://addons/.
  3. Enable ss-gameforge-singleton and ss-gameforge-wired in Project Settings → Plugins.

After enabling the plugin, a GodotWired tab appears in the Godot editor’s main screen (next to 2D/3D/Script).

Use it to:

  • Set the player mode (SINGLE, LOCAL_COOP, ONLINE) and max local players.
  • Add, rename, and remove actions.
  • Set each action’s display name, description, category, type (Button or Axis), and whether it allows rebinding.
  • Save the configuration as a GWConfig resource (default: res://gw_config.tres).

Default bindings are added via code with define_action(), or set directly on the GWConfig resource in the inspector.

ClassDescription
GWInputManagerCentral coordinator — singleton entry point for all input operations.
GWConfigProject-level configuration resource (player mode, max players, action list).
GWActionConfigTemplate defining a single action (name, bindings, category, type).
GWPlayerLogical player with its own devices and independent copies of all actions.
GWActionPer-player runtime action instance (independently rebindable).
GWBindingA single physical input mapping (key, button, axis, mouse button).
GWDeviceAbstraction over a physical device (keyboard/mouse or gamepad).
GWProfileManagerStatic utility for named save/load binding profiles.

Create via the editor panel, or New Resource → GWConfig in the inspector.

enum PlayerMode {
SINGLE, # One player — keyboard + any gamepad
LOCAL_COOP, # N players — each gets an exclusive device
ONLINE, # One local player, the rest managed by the network layer
}
@export var player_mode: PlayerMode = SINGLE
@export_range(2, 8) var max_local_players: int = 2
@export var actions: Array[GWActionConfig] = []

Load the config at startup:

var config := preload("res://gw_config.tres") as GWConfig
GWInputManager.i.load_config(config)
FieldTypeDescription
action_nameStringInternal identifier used in gameplay code (e.g. "jump").
display_nameStringLabel shown in the rebind UI (e.g. "Jump").
descriptionStringOptional tooltip in the rebind screen.
categoryStringGroups actions in the UI (e.g. "Movement", "Combat").
max_bindingsintMax simultaneous bindings per player. 0 = unlimited.
action_typeActionTypeBUTTON or AXIS.
positive_nameStringAxis only — label for the +1.0 direction (e.g. "right").
negative_nameStringAxis only — label for the -1.0 direction (e.g. "left").
allow_rebindboolIf false, the action does not appear as editable in the rebind UI.
default_bindingsArray[GWBinding]Bindings cloned into each player on load_config().

Use the static factory methods to create bindings:

GWBinding.from_key(KEY_SPACE)
GWBinding.from_key(KEY_W)
GWBinding.from_joy_button(JOY_BUTTON_A)
GWBinding.from_joy_axis(JOY_AXIS_LEFT_Y, -1.0) # Analog up
GWBinding.from_mouse_button(MOUSE_BUTTON_LEFT)

Use get_display_name() to get a human-readable label for any binding:

var b: GWBinding = action.bindings[0]
label.text = b.get_display_name() # "Space", "W", "Pad A", "Pad LX +", "Mouse L", etc.

Each axis binding has a deadzone (default 0.2) below which the stick reads as released.

func _enter_tree() -> void:
GWInputManager.ensure(get_tree().root)
var p1 := GWInputManager.i.create_player(0, "Player 1")
var p2 := GWInputManager.i.create_player(1, "Player 2")
GWInputManager.i.get_player(player_id) -> GWPlayer
GWInputManager.i.get_default_player() -> GWPlayer # shorthand for get_player(0)
GWInputManager.i.remove_player(player_id)

Player 0 is the default, so single-player code can leave player_id out. Safe to call from _process() or _physics_process() — no InputEvent required:

GWInputManager.i.is_action_pressed("jump", player_id)
GWInputManager.i.is_action_just_pressed("jump", null, player_id) # frame-tracked
GWInputManager.i.is_action_just_released("jump", null, player_id) # frame-tracked
GWInputManager.i.get_action_strength("move_right", player_id)
GWInputManager.i.get_action_axis("move_horizontal", player_id)
GWInputManager.i.get_vector("move_left", "move_right", "move_up", "move_down", player_id)

A press counts once: holding a stick, key repeat, or pressing a second binding of an action that is already held does not fire is_action_just_pressed() again, and the release fires only when no binding is held anymore.

For event-based queries (from _input() or _unhandled_input()), pass the event instead of null:

func _input(event: InputEvent) -> void:
if GWInputManager.i.is_action_just_pressed("jump", event):
velocity.y = -400.0
GWInputManager.i.define_action(
"jump", # action_name
"Jump", # display_name
[GWBinding.from_key(KEY_SPACE), GWBinding.from_joy_button(JOY_BUTTON_A)],
"Movement", # category
2 # max_bindings
)
# An axis action reads back in [-1.0, 1.0] through get_action_axis()
GWInputManager.i.define_axis(
"move_x", "Move",
[GWBinding.from_key(KEY_D), GWBinding.from_joy_axis(JOY_AXIS_LEFT_X, 1.0)], # positive
[GWBinding.from_key(KEY_A), GWBinding.from_joy_axis(JOY_AXIS_LEFT_X, -1.0)], # negative
"Movement", 2, "Right", "Left"
)

Define every action before create_player(): that is when the templates are cloned into the player.

Rebinding is a listen mode: the manager captures the next valid input from a device the player owns and writes it into the slot you named. Input from other players’ devices is ignored, so P1 cannot rebind with P2’s pad.

# Start listening for the player's next input. Returns false when the player
# or action does not exist, or the action has allow_rebind = false.
GWInputManager.i.start_rebind_listen(player_id, "jump", binding_index)
# The negative side of an axis action
GWInputManager.i.start_rebind_listen(player_id, "move_x", 0, true)
# Cancel an active listen
GWInputManager.i.cancel_rebind_listen()
# Check if currently listening
GWInputManager.i.is_listening_for_rebind() -> bool
  • binding_index is the slot to overwrite: 0 is the primary binding, 1 the first alternate. A slot past max_bindings cancels the rebind (rebind_cancelled instead of binding_remapped).
  • While listening, gameplay queries receive no input, so the key being captured does not also trigger what it is bound to today.
  • Captured gamepad bindings are stored with device_id = -1 (“any pad this player owns”), so they keep working after a reconnect or on another machine.
  • If the new input is already bound to other actions of the same player, the rebind is kept and rebind_conflict fires so your screen can warn or swap.
GWInputManager.i.save_all_profiles() # default: user://gw_bindings.json
GWInputManager.i.load_all_profiles()
GWInputManager.i.reset_all_to_defaults()

load_all_profiles() does nothing if the file is missing and only applies to players that already exist — create the players first, then load. Besides bindings it restores each player’s accepts_keyboard and accepts_any_gamepad. Gamepad assignments are not saved, since device ids change between sessions.

GWInputManager.i.get_connected_devices() -> Array # all devices including keyboard/mouse
GWInputManager.i.get_unassigned_gamepads() -> Array # gamepads not yet assigned to any player

A pad that disconnects is handed back to the same player when it reconnects.

signal player_created(player_id: int)
signal player_removed(player_id: int)
signal device_connected(device_id: int, device_name: String)
signal device_disconnected(device_id: int)
signal binding_remapped(player_id: int, action_name: String)
signal rebind_listening(player_id: int, action_name: String, binding_index: int)
signal rebind_cancelled(player_id: int)
signal rebind_conflict(player_id: int, action_name: String, conflicting_actions: Array[String])
signal unassigned_device_pressed(device_id: int) # "press to join" support
# Device assignment
p1.assign_gamepad(device_id)
p1.unassign_gamepad(device_id)
p1.unassign_all_gamepads()
p1.accepts_keyboard = true # allow this player to use keyboard/mouse
p1.accepts_any_gamepad = true # read every connected pad no other player has claimed
p1.has_any_device() -> bool
p1.owns_device(device_id) -> bool
# Input queries (polling — no InputEvent needed)
p1.is_action_pressed("jump")
p1.get_action_strength("move_right")
p1.get_action_axis("move_horizontal") # returns -1.0 to 1.0
p1.get_vector("move_left", "move_right", "move_up", "move_down")
# Event-based queries (from _input / _unhandled_input)
p1.is_action_just_pressed("jump", event)
p1.is_action_just_released("jump", event)
# Rebinding
p1.set_binding("jump", index, binding) # pass negative = true for an axis's negative side
p1.clear_action_bindings("jump")
p1.find_conflicts(event, exclude_action) # returns Array[GWAction]
signal device_assigned(device_id: int)
signal device_unassigned(device_id: int)
signal action_rebound(action_name: String)

Static utility for saving and loading named binding profiles. Each profile is stored as a separate file: gw_profile_{name}.json.

GWProfileManager.save(GWInputManager.i, "player1_config")
GWProfileManager.load_profile(GWInputManager.i, "player1_config")
GWProfileManager.profile_exists("player1_config") -> bool
GWProfileManager.list_profiles() -> Array[String]
GWProfileManager.delete_profile("player1_config")
extends Node
func _enter_tree() -> void:
GWInputManager.ensure(get_tree().root)
func _ready() -> void:
GWInputManager.i.define_action(
"jump", "Jump",
[GWBinding.from_key(KEY_SPACE), GWBinding.from_joy_button(JOY_BUTTON_A)],
"Movement", 2
)
GWInputManager.i.define_axis(
"move_horizontal", "Move",
[GWBinding.from_key(KEY_D), GWBinding.from_joy_axis(JOY_AXIS_LEFT_X, 1.0)],
[GWBinding.from_key(KEY_A), GWBinding.from_joy_axis(JOY_AXIS_LEFT_X, -1.0)],
"Movement", 2, "Right", "Left"
)
var p1 := GWInputManager.i.create_player(0)
p1.accepts_keyboard = true
p1.accepts_any_gamepad = true
func _physics_process(_delta: float) -> void:
if GWInputManager.i.is_action_just_pressed("jump"):
velocity.y = -400.0
velocity.x = GWInputManager.i.get_action_axis("move_horizontal") * 200.0
func _ready() -> void:
var config := preload("res://gw_config.tres") as GWConfig
GWInputManager.i.load_config(config) # player_mode = LOCAL_COOP, max = 4
# load_config() clears every template and player first: call it at startup.
GWInputManager.i.unassigned_device_pressed.connect(_on_press_to_join)
var _player_count := 0
func _on_press_to_join(device_id: int) -> void:
var p := GWInputManager.i.create_player(_player_count)
p.assign_gamepad(device_id)
_player_count += 1
print("Player %d joined with device %d" % [_player_count, device_id])

Use GWInputManager signals to build your own rebind screen:

# Show the current binding label
func refresh_binding_label(player_id: int, action_name: String) -> void:
var p := GWInputManager.i.get_player(player_id)
var action: GWAction = p.actions[action_name]
if action.bindings.is_empty():
label.text = "Unassigned"
else:
label.text = action.bindings[0].get_display_name()
# Start listening
func _on_rebind_button_pressed() -> void:
GWInputManager.i.start_rebind_listen(0, "jump", 0)
# React when remapping completes, and warn about conflicts
func _ready() -> void:
GWInputManager.i.binding_remapped.connect(
func(pid, action): refresh_binding_label(pid, action)
)
GWInputManager.i.rebind_conflict.connect(func(pid, action, others):
warning.text = "%s is also used by %s" % [action, ", ".join(others)]
)