Gamepad

Category: Listener Tier: Basic

Purpose

Detects gamepad input across buttons, D-Pad directions, analog stick axes, and analog triggers.

Visual Reference

As added to your scene
Gamepad brick as it appears in the GDLink editor

When To Use

Character Movement

Gamepad(Axis Left Stick X Any, expose=move_x) -> Motion(vector.x = {move_x})
Gamepad(Axis Left Stick Y Any, expose=move_z) -> Motion(vector.z = {-move_z})

Vehicle Steering / Throttle

Gamepad(Axis Left Stick X Any, expose=steer_cmd) -> Vehicle3D(steer_input = {steer_cmd})
Gamepad(Trigger RT Hold, expose=throttle_cmd) -> Vehicle3D(throttle_input = {throttle_cmd})
Gamepad(Trigger LT Hold, expose=brake_cmd) -> Vehicle3D(brake_input = {brake_cmd})

Menu Navigation

Gamepad(D-Pad Up Press) -> PRINT / Variable / Message
Gamepad(D-Pad Down Press) -> PRINT / Variable / Message
Gamepad(Button A Press) -> confirm
Gamepad(Button B Press) -> back

Runtime Behavior

Button Uses native joy button state and edge tracking.

  • Press: true once when the button goes from up to down

  • Release: true once when the button goes from down to up

  • Hold: true continuously while the button remains down

D-Pad Uses the same native button-state edge logic as standard buttons.

  • Press: fires when the selected D-Pad direction first engages

  • Release: fires when that direction is released

  • Hold: stays true while the direction is held

Axis Reads the configured stick axis, applies dead-zone filtering, then evaluates against the selected direction and threshold.

  • Positive: active when axis_value > threshold

  • Negative: active when axis_value < -threshold

  • Any: active when abs(axis_value) > threshold

Axis now supports full analog edge tracking:

  • Press: fires once when the filtered value crosses into the active threshold region

  • Release: fires once when it exits that threshold region

  • Hold: stays true while it remains inside that region

Trigger Reads the configured trigger axis, applies dead-zone filtering, then compares against axis_threshold.

  • Press: fires once when trigger value crosses above threshold

  • Release: fires once when it falls back below threshold

  • Hold: stays true while above threshold

Generated UI Mockup — showing expanded properties
Gamepad
-
x
Name:
Label this brick...
Device:
0
v
Input Type:
Button
Button:
A
Axis:
Left Stick X
D-Pad:
Up
Trigger:
LT
Event:
Press
Direction:
Positive
Threshold:
0.5
v
Dead Zone:
0.2
v
Scope:
Local
Expose Prefix:
gamepad
v
Expose Value
Expose Data
Invert

Properties

Property

Type

Default

Notes

Device

int

0

Gamepad device ID (0-7, -1 for any)

Input Type

option

Button

Type of input

Button

option

A

[Button] Which button

Axis

option

Left Stick X

[Axis] Which analog stick

D-Pad

option

Up

[D-Pad] Direction

Trigger

option

LT

[Trigger] Left or Right trigger

Event

option

Press

When to fire: edge press, edge release, or continuous hold/threshold-active

Direction

option

Positive

[Axis] Which direction to detect

Threshold

float

0.5

[Axis/Trigger] Minimum value to trigger

Dead Zone

float

0.2

Ignore input below this value

Expose Value

bool

False

[Axis/Trigger] Write the raw analog value into a variable every tick

Variable

variable_name

[Axis/Trigger] Variable that receives the analog value

Scope

option

Local

Where exposed variables are written (shared by both exposure blocks below)

Expose Data

bool

False

Write device id, input type, code, value, and active flag into variables when the listener fires

Device Var

variable_name

Variable that receives the device id

Type Var

variable_name

Variable that receives the input type

Code Var

variable_name

Variable that receives the input code

Value Var

variable_name

Variable that receives the input value

Active Var

variable_name

Variable that receives whether the input is active

Expose Prefix

string

gamepad

Compatibility fallback when explicit output variables are empty

Invert

bool

False

Trigger when NOT pressed/moved

Notes

  • Dead-zone values near 0.1 .. 0.2 are usually appropriate for healthy controllers.

  • Larger dead-zones can hide stick drift on worn hardware.

  • Trigger thresholds around 0.1 .. 0.3 feel responsive for brake/throttle style input.

  • For clean logs on Hold, use a Delay listener into the same gate to throttle output.


Last Updated: April 18, 2026
Version: v0.8.98.2-dev1