From e9a7f5e748719ce5b6ccd08ff91861b578034ea6 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 9 Oct 2022 08:18:15 -0400 Subject: events: Add support for take-focus and hit-test window events. --- sdl2/events.scm | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/sdl2/events.scm b/sdl2/events.scm index b019ad4..2ba341a 100644 --- a/sdl2/events.scm +++ b/sdl2/events.scm @@ -279,22 +279,25 @@ (define (parse-window-event ptr) (define (type-symbol n) - (list-ref '(none - shown - hidden - exposed - moved - resized - size-changed - minimized - maximized - restored - enter - leave - focus-gained - focus-lost - close) - (1- n))) + (cond + ((= n ffi:SDL_WINDOWEVENT_NONE) 'none) + ((= n ffi:SDL_WINDOWEVENT_SHOWN) 'shown) + ((= n ffi:SDL_WINDOWEVENT_HIDDEN) 'hidden) + ((= n ffi:SDL_WINDOWEVENT_EXPOSED) 'exposed) + ((= n ffi:SDL_WINDOWEVENT_MOVED) 'moved) + ((= n ffi:SDL_WINDOWEVENT_RESIZED) 'resized) + ((= n ffi:SDL_WINDOWEVENT_SIZE_CHANGED) 'size-changed) + ((= n ffi:SDL_WINDOWEVENT_MINIMIZED) 'minimized) + ((= n ffi:SDL_WINDOWEVENT_MAXIMIZED) 'maximized) + ((= n ffi:SDL_WINDOWEVENT_RESTORED) 'restored) + ((= n ffi:SDL_WINDOWEVENT_ENTER) 'enter) + ((= n ffi:SDL_WINDOWEVENT_LEAVE) 'leave) + ((= n ffi:SDL_WINDOWEVENT_FOCUS_GAINED) 'focus-gained) + ((= n ffi:SDL_WINDOWEVENT_FOCUS_LOST) 'focus-lost) + ((= n ffi:SDL_WINDOWEVENT_CLOSE) 'close) + ((= n ffi:SDL_WINDOWEVENT_TAKE_FOCUS) 'take-focus) + ((= n ffi:SDL_WINDOWEVENT_HIT_TEST) 'hit-test) + (else 'unknown))) (define types (list uint32 ; type -- cgit v1.2.3