Skip to content

API Variable InputDevice

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Variable: InputDevice

const InputDevice: DataComponentDef<{
  connected: ScalarType<"u8">;
  device: ScalarType<"i32">;
  family: ScalarType<"u8">;
  kind: ScalarType<"u8">;
  player: ScalarType<"i32">;
  slot: ScalarType<"i32">;
}>;

Defined in: src/engine/input/deviceEntities.ts:29

A device this World sees. device is the adapter's id (-1 keyboard, -2 pointer, -3 touchscreen, -4 pen, gamepads ≥ 0), slot the gamepad's order of connection (0 first; keyboard and pointer 0), player the index of the player it's paired with (ADR 0337), -1 for none. connected drops to 0 for the frame a gamepad is unplugged, then its node is destroyed.

Clone this wiki locally