summaryrefslogtreecommitdiff
path: root/sdl2/events.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2022-10-09 08:18:15 -0400
committerDavid Thompson <dthompson2@worcester.edu>2022-10-09 08:18:15 -0400
commite9a7f5e748719ce5b6ccd08ff91861b578034ea6 (patch)
tree12130452687cddcdcafc09ac249af9075f6a4be0 /sdl2/events.scm
parentd1cc13011dd5cdc1f44d0d05ab15ccaf44e91bdd (diff)
events: Add support for take-focus and hit-test window events.
Diffstat (limited to 'sdl2/events.scm')
-rw-r--r--sdl2/events.scm35
1 files 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