Joystick

A virtual analog stick or directional pad for continuous 2D input. Fires throttled actions with x and y values ranging from -1 to 1.

Type

"joystick"

Relevant Fields

Inherits all Control Definition. Key fields:

Field Type Default Description
label string falls back to id Header label
tint color "#667eea" Stick and track color
style string "analog" "analog" (free) or "dpad" (4/8-direction snapping)
deadzone number 0.1 Center deadzone radius (0-1)
sticky bool false Stick stays where released instead of snapping to center
sendRate number 0.1 Throttle interval in seconds for action firing
hideLabel bool false Hide label and coordinate readout

Examples

Robot drive controller

{
  "type": "joystick",
  "id": "drive-stick",
  "position": [0, 0],
  "span": [2, 2],
  "label": "Drive",
  "tint": "#FF2D55",
  "style": "analog",
  "deadzone": 0.15,
  "sendRate": 0.05,
  "action": { "method": "meshsocket", "mode": "send", "event": "route_msg_noreply", "payload": { "target_name": "robot", "type": "drive", "payload": { "x": "$value.x", "y": "$value.y" } } }
}