From e7d470e954d0a17ab1b2fe0065f46f78475272f9 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 8 Apr 2020 17:10:29 -0400 Subject: Add chickade 0.5.0 stuff. --- manuals/chickadee/Input-Devices.html | 156 +++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 manuals/chickadee/Input-Devices.html (limited to 'manuals/chickadee/Input-Devices.html') diff --git a/manuals/chickadee/Input-Devices.html b/manuals/chickadee/Input-Devices.html new file mode 100644 index 0000000..0b50481 --- /dev/null +++ b/manuals/chickadee/Input-Devices.html @@ -0,0 +1,156 @@ + + + + + + +Input Devices (The Chickadee Game Toolkit) + + + + + + + + + + + + + + + + + + + +
+

+Next: , Previous: , Up: Kernel   [Contents][Index]

+
+
+

2.1.2 Input Devices

+ +

While run-game provides hooks for mouse/keyboard/controller +input events, it is often necessary to query input devices for their +current state. For example, it could be desirable to query the state +of the arrow keys every time the update hook is called to determine +which direction the player should move that frame. +

+
+
Procedure: key-pressed? key
+

Return #t if key is currently being pressed. +

+ +
+
Procedure: key-released? key
+

Return #t if key is not currently being pressed. +

+ +
+
Procedure: mouse-x
+

Return the current X coordinate of the mouse cursor. +

+ +
+
Procedure: mouse-y
+

Return the current Y coordinate of the mouse cursor. +

+ +
+
Procedure: mouse-button-pressed? button
+

Return #t if button is currently being pressed. +

+ +
+
Procedure: mouse-button-released? button
+

Return #t if button is not currently being +pressed. +

+ +
+
Procedure: controller-axis controller axis
+

Return a floating point value in the range [-1, 1] corresponding to +how much axis (an analog stick or trigger) is being pushed on +controller. 0 is returned if axis is not being pushed at +all. +

+ +
+
Procedure: controller-name controller
+

Return the name of controller. +

+ +
+
Procedure: controller-button-pressed? controller button
+

Return #t if button on controller is currently +being pressed. +

+ +
+
Procedure: controller-button-released? controller button
+

Return #t if button on controller is not +currently being pressed. +

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