Gamepad
A connection-scoped controller handle; reconnecting invalidates the old handle.
Static methods
function hxnAdopt(hxnRaw:Handle):GamepadAn object for a value the library returned.
function available():BoolWhether the platform backend initialized, including when no controllers are connected.
function error():StringWhy the backend is unavailable, or an empty string.
function count():Intfunction at(index:Int):GamepadA connected controller in enumeration order, or an invalid handle.
function fromId(deviceId:Int):Gamepadfunction poll():GamepadEventfunction drain(output:Bytes):IntDrain whole 32-byte records into reused storage without constructing event objects. u32 kind, i32 device, u32 control, u32 pressed, f64 value, u64 dropped. Kinds match GamepadEvent variants. Returns count; a short buffer consumes nothing.
Properties
var hxnRaw:HandleMethods
function valid():Boolfunction deviceId():Intfunction name():Stringfunction hasButton(button:GamepadButton):Boolfunction hasAxis(axis:GamepadAxis):Boolfunction button(button:GamepadButton):Floatfunction pressed(button:GamepadButton):Boolfunction axis(axis:GamepadAxis):Floatfunction snapshot(output:Bytes):BoolAtomically copy into a reused 176-byte buffer: 17 little-endian f64 button values, 4 f64 axes, a u32 pressed mask and a u32 change sequence. False for an invalid handle or short buffer; no bytes are written then.
function rumbleSupported():Boolfunction rumble(strong:Float, weak:Float, seconds:Float):BoolStart or replace finite dual-motor rumble; zero duration stops it. Magnitudes are [0,1], seconds [0,5]. Reports backend acceptance.
function close():VoidReleases the native value now. The collector does it otherwise. Using this object afterwards throws.