Getting Started Cameras & Video Detection & Recording Automation & Events Actions Integration & Connectivity Network & Discovery AI & Remote Control MQTT Modbus ZeroMQ System & Administration Use Cases Troubleshooting About & Legal
Home / Documentation / Gamepad State Controller
Knowledge base

Gamepad State Controller

Gamepad state controller centralizes gamepad input handling for Banalytics. It consumes raw browser gamepad state snapshots, maintains per-device axis and button state, filters small noise, and emits clean axis and button change events for remote control workflows.

Normalize gamepad input into control events

The controller receives raw GamePadStateChangedEvent snapshots from browser/client sources compatible with the Web Gamepad API. It compares the latest state with the previous in-memory state and emits derivative GPAxisChangeEvent and GPButtonChangeEvent events only when changes pass configured thresholds.

PAD

Gamepad state

Tracks axes and buttons per gamepad identifier and remembers known controller IDs across sessions.

FLT

Noise filtering

Suppresses tiny analog changes that would otherwise create jitter in PTZ, vehicle, or hardware-control actions.

EVT

Derivative events

Emits axis and button change events that downstream Event Manager rules and actions can consume.

Singleton component: this component has a fixed UUID, 00000000-0000-0000-0000-000000000011, so other modules can reference the same gamepad registry and event source.

Preparing a gamepad control source

01

Start the controller

Keep the Gamepad State Controller running when downstream actions need joystick or button input.

02

Connect and move the controller

Open the controller UI and move each gamepad once so its identifier is observed and saved for dropdowns in downstream actions.

03

Set current as zero state

Use zero-state calibration when sticks or triggers do not rest exactly at zero. This helps downstream controls receive centered values while the operator is idle.

04

Tune thresholds

Adjust axis and button thresholds to balance smooth control, noise suppression, and event rate.

Remote control use cases

PTZ

PTZ joystick control

Map axis-change events to pan, tilt, zoom, speed, or direction for camera control actions.

DRV

Rover and drone control

Use axes and buttons as an operator input source for motor PWM, flight controls, relays, or other real-time commands.

PLC

Industrial and Modbus control

Map controller inputs to Modbus registers, coils, or other gateway commands in supervised manual-control workflows.

Verify before operating equipment: browser, operating system, and controller driver can expose different axis and button indexes for the same physical device. Always verify indexes in the UI before binding actions.

Tuning thresholds for precision and stability

Thresholds control when small changes become events. Low thresholds preserve fine movement but can amplify noisy hardware. High thresholds reduce event volume and jitter but can make controls feel sluggish.

Noisy sticks
Increase axisThreshold when idle sticks generate constant tiny axis changes.
Fine PTZ movement
Decrease axisThreshold when slow, precise joystick movement should be preserved.
Analog triggers
Tune buttonThreshold when pressure-sensitive buttons or triggers fluctuate around a value.
Event load
Raise thresholds if downstream rules receive too many events from noisy or high-rate controller input.

Working with multiple controllers

ID

Learn gamepad identifiers

Press a button or move a stick on each controller so the registry observes and persists its identifier.

MAP

Bind downstream actions

Use gamepad ID dropdowns in downstream actions to bind a rule or action to the intended controller.

SAFE

Avoid cross-control

Configure PTZ, rover, drone, or Modbus actions to listen only to the expected gamepad ID so one operator does not control the wrong device.

Configuration parameters

ParameterRequiredDescriptionDefault
Axis threshold
YesMinimum absolute axis value delta required to emit a GPAxisChangeEvent. Step is 0.0001.0.002
Button threshold
YesMinimum absolute button value delta required to emit a GPButtonChangeEvent for analog button value changes. Step is 0.0001.0.002

Events emitted or consumed by the controller

EventDirectionKey fieldsUse
GamePadStateChangedEvent
ConsumedgamepadId, axes, buttonsRaw browser snapshot
GPAxisChangeEvent
EmittedaxisIndex, valueJoystick movement
GPButtonChangeEvent
EmittedgamepadId, buttonIndex, pressed, touched, valueButton and trigger changes
GyroscopeEvent
RelatedxAngular, yAngular, zAngularClient angular velocity
GravityEvent
RelatedxAngular, yAngular, zAngularClient gravity sensor

Operational notes

MEM

State resets on restart

In-memory axis and button state is cleared on component start and stop. The first raw event after reconnect initializes the current state for that gamepad.

REG

Known IDs are persisted

Known gamepad identifiers are stored in instances/gamepad-ids.json under the agent configuration folder.

BTN

Button transitions are always important

Button press and touch transitions generate button-change events even if the analog value changes only slightly.

Related remote control pages

Use these pages to connect gamepad events to cameras, rules, and operator workflows.

Related tasks and pages