From 2fd545051eb6307ab2a3fe70e69af27cb44e96cb Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 16 Dec 2015 20:47:20 -0500 Subject: 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 (): 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. --- sdl2/bindings.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sdl2/bindings.scm') 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 -- cgit v1.2.3