summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-04-08 08:58:50 -0400
committerDavid Thompson <dthompson2@worcester.edu>2020-04-08 08:58:50 -0400
commita68113f1971ccf41da055a40040e76f27ad38520 (patch)
treebe11e2ef156059bd653f398ec961fafad353d3ba /chickadee.scm
parent906324737e5622770d36784fac88675e9557d166 (diff)
Add controller-button-released? procedure.
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 876c59e..4edeb03 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -63,6 +63,7 @@
set-window-position!
set-window-fullscreen!
controller-button-pressed?
+ controller-button-released?
controller-axis
controller-name
key-pressed?
@@ -118,6 +119,10 @@
"Return #t if BUTTON is currently being pressed on CONTROLLER."
(sdl2:game-controller-button-pressed? controller button))
+(define (controller-button-released? controller button)
+ "Return #t if BUTTON is not currently being pressed on CONTROLLER."
+ (not (controller-button-pressed? controller button)))
+
(define (controller-axis controller axis)
"Return a floating point value in the range [-1, 1] corresponding to
how much AXIS is being pushed on CONTROLLER. 0 is returned if AXIS is