from_index : U64 -> Try(Id, [InvalidGamepadIndex, ..])
Validate and wrap a raw gamepad slot index.
Gamepad helpers for input.devices.gamepads.
The types and pure helpers live in the companion roc-ray-types package so
reusable packages can depend on them without depending on this platform.
This module re-exports them, so the nominal types are shared either way.
Pass input.devices directly to these helpers; there is nothing to
construct.
from_index : U64 -> Try(Id, [InvalidGamepadIndex, ..])
Validate and wrap a raw gamepad slot index.
lookup : Snapshot, Id -> [Connected(View), Disconnected]
Resolve a gamepad slot in a sampled snapshot.
Whether a gamepad slot is connected in this input's latest sample.
button_down : { ..state, buttons : List(U8) }, Id, Button -> Bool
Check if a gamepad button is currently held down.
Check if a gamepad button is currently up.
button_pressed : { ..state, buttons : List(U8) }, Id, Button -> Bool
Check if a gamepad button was pressed during this input interval.
button_released : { ..state, buttons : List(U8) }, Id, Button -> Bool
Check if a gamepad button was released during this input interval.
Sampled value for one axis, in the range raylib reports.
left_stick : { ..state, axes : List(F32) }, Id -> { x : F32, y : F32 }
Left analogue stick as a two-axis vector.
right_stick : { ..state, axes : List(F32) }, Id -> { x : F32, y : F32 }
Right analogue stick as a two-axis vector.
Snapshot : Snapshot
Gamepad input sampled once per host-cycle input for every slot.
Declared in the roc-ray-types package's Gamepad and re-exported here,
which is also where its receivers are documented.
Id : Id
The four gamepad slots the platform samples.
Button : Button
Face, shoulder, d-pad, and stick buttons.
Axis : Axis
Analogue stick and trigger axes.
View : View
A gamepad resolved against a snapshot, carrying its receivers.
Pure types and receivers: roc-ray-types Gamepad