summaryrefslogtreecommitdiff
path: root/sdl2/bindings.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-12-16 20:47:20 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-12-16 20:47:20 -0500
commit2fd545051eb6307ab2a3fe70e69af27cb44e96cb (patch)
treec9717ceb885313571ed08660fc6c805a9028e1e3 /sdl2/bindings.scm
parent5679a233b55f1a6919bc14d54683c1c84bc15652 (diff)
events: mouse: Add motion event bindings.
* sdl2/bindings.scm (button-mask): New procedure. (SDL_BUTTON_LMASK, SDL_BUTTON_RMASK, SDL_BUTTON_MMASK, SDL_BUTTON_X1MASK, SDL_BUTTON_X2MASK): New variables. * sdl2/events.scm (<mouse-motion-event>): New record type. (make-mouse-motion-event mouse-motion-event?, mouse-motion-event-timestamp, mouse-motion-event-window-id, mouse-motion-event-which, mouse-motion-event-buttons, mouse-motion-event-x, mouse-motion-event-y, mouse-motion-event-x-rel, mouse-motion-event-y-rel, parse-mouse-motion-event): New procedures.
Diffstat (limited to 'sdl2/bindings.scm')
-rw-r--r--sdl2/bindings.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/sdl2/bindings.scm b/sdl2/bindings.scm
index 43f0be6..a25822f 100644
--- a/sdl2/bindings.scm
+++ b/sdl2/bindings.scm
@@ -816,6 +816,16 @@ RETURN-TYPE and accept arguments of ARG-TYPES."
(define-public SDL_BUTTON_X1 4)
(define-public SDL_BUTTON_X2 5)
+(define (button-mask n)
+ (ash 1 (1- n)))
+
+(define-public SDL_BUTTON_LMASK (button-mask SDL_BUTTON_LEFT))
+(define-public SDL_BUTTON_MMASK (button-mask SDL_BUTTON_MIDDLE))
+(define-public SDL_BUTTON_RMASK (button-mask SDL_BUTTON_RIGHT))
+(define-public SDL_BUTTON_X1MASK (button-mask SDL_BUTTON_X1))
+(define-public SDL_BUTTON_X2MASK (button-mask SDL_BUTTON_X2))
+
+
;;;
;;; Timer