From 9224412274e1e1a31a959083bb257a7d6ab2b113 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 19 Aug 2016 20:40:12 -0400 Subject: Add Sly manual. --- manuals/sly/Joystick.html | 188 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 manuals/sly/Joystick.html (limited to 'manuals/sly/Joystick.html') diff --git a/manuals/sly/Joystick.html b/manuals/sly/Joystick.html new file mode 100644 index 0000000..68748c3 --- /dev/null +++ b/manuals/sly/Joystick.html @@ -0,0 +1,188 @@ + + + + + +Sly: Joystick + + + + + + + + + + + + + + + + + + + + +
+

+Previous: , Up: Input   [Contents][Index]

+
+
+ +

4.4.3 Joystick

+ +
+
(use-modules (sly input joystick))
+
+ +

Joystick hooks, signals, and procedures. +

+

Before using joystick procedures, you must first call the +initialization procedure enable-joystick. +

+
+
Scheme Procedure: enable-joystick
+

Initialize joystick module. +

+ +
+
Scheme Procedure: joystick-num-axes idx
+

Get number of axes of joystick at idx. +

+ +
+
Scheme Procedure: joystick-num-buttons idx
+

Get number of buttons of joystick at idx. +

+ +
+
Scheme Variable: joystick-axis-hook
+

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. +

+ +
+
Scheme Variable: joystick-button-press-hook
+

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. +

+ +
+
Scheme Variable: joystick-button-release-hook
+

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. +

+ +
+
Scheme Variable: raw-axis-min
+

-32768 +

+ +
+
Scheme Variable: raw-axis-max
+

32767 +

+ +
+
Scheme Procedure: axis-value-raw idx axis
+

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]. +

+ +
+
Scheme Procedure: axis-value idx axis
+

Create a signal for the value of axis on joystick idx; +values are scaled to the range [-1,1]. +

+ +
+
Scheme Procedure: button-down? idx n
+

Create a signal for the state of button n on joystick at +idx. +

+ +
+
Scheme Procedure: make-directional-signal idx x-axis y-axis
+

Create a signal for a directional pad or analog stick with x +and y axes. Values are scaled to the range [-1,1]. +

+ +
+
Scheme Procedure: make-directional-signal-raw idx x-axis y-axis
+

Create a signal for a directional pad or analog stick with x +and y axes. Values range from [raw-axis-min, +raw-axis-max]. +

+ +
+
Scheme Procedure: axis-scale raw-value
+

Map raw-value in the range [raw-axis-min, +raw-axis-max] to a value in the range [-1, 1]. +

+ +
+
Scheme Procedure: joystick-name joystick
+

Return the name of joystick. +

+ +
+
Scheme Procedure: num-joysticks
+

Return the number of joysticks available. +

+
+
+

+Previous: , Up: Input   [Contents][Index]

+
+ + + + + -- cgit v1.2.3