From 3b814d7eb0b60c691803aa8681bcbd222acac36d Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 10 Nov 2017 21:29:40 -0500 Subject: input: mouse: Add mouse-button-released? * sdl2/input/mouse.scm (mouse-button-released?): New procedure. --- sdl2/input/mouse.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdl2/input/mouse.scm b/sdl2/input/mouse.scm index 55c7833..c172909 100644 --- a/sdl2/input/mouse.scm +++ b/sdl2/input/mouse.scm @@ -31,7 +31,8 @@ #:use-module (system foreign) #:export (mouse-x mouse-y - mouse-button-pressed?)) + mouse-button-pressed? + mouse-button-released?)) (define (make-int) (make-bytevector (sizeof int))) @@ -65,3 +66,7 @@ ('x2 ffi:SDL_BUTTON_X2MASK))) (buttons (ffi:sdl-get-mouse-state %null-pointer %null-pointer))) (> (logand mask buttons) 0))) + +(define (mouse-button-released? button) + "Return #t if BUTTON is not currently being pressed." + (not (mouse-button-pressed? button))) -- cgit v1.2.3