(use-modules (sly input joystick))
Joystick hooks, signals, and procedures.
Before using joystick procedures, you must first call the
initialization procedure enable-joystick
.
Initialize joystick module.
Get number of axes of joystick at idx
.
Get number of buttons of joystick at idx
.
This hook is run whenever a joystick motion occurs. Procedures added
to this hook should accept three arguments: which
, the joystick
ID; axis
, the axis ID; and value
, the motion coordinate.
This hook is run whenever a joystick button is pressed. Procedures
added to this hook should accept two arguments: which
, the
joystick ID; button
, the button ID.
This hook is run whenever a joystick button is released. Procedures
added to this hook should accept two arguments: which
, the
joystick ID; button
, the button ID.
-32768
32767
Create a signal on the axis at axis
of the joystick at
idx; joystick axis values are stored in a signed 16 bit integer
and so, values range from [raw-axis-min
, raw-axis-max
].
Create a signal for the value of axis on joystick idx; values are scaled to the range [-1,1].
Create a signal for the state of button n
on joystick at
idx
.
Create a signal for a directional pad or analog stick with x
and y
axes. Values are scaled to the range [-1,1].
Create a signal for a directional pad or analog stick with x
and y
axes. Values range from [raw-axis-min
,
raw-axis-max
].
Map raw-value
in the range [raw-axis-min
,
raw-axis-max
] to a value in the range [-1, 1].
Return the name of joystick
.
Return the number of joysticks available.