Add controller-button-released? procedure.
authorDavid Thompson <dthompson2@worcester.edu>
Wed, 8 Apr 2020 12:58:50 +0000 (08:58 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Wed, 8 Apr 2020 12:58:50 +0000 (08:58 -0400)
chickadee.scm

index 876c59e..4edeb03 100644 (file)
@@ -63,6 +63,7 @@
             set-window-position!
             set-window-fullscreen!
             controller-button-pressed?
+            controller-button-released?
             controller-axis
             controller-name
             key-pressed?
   "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