summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-06-25 18:16:17 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-06-25 18:16:17 -0400
commit6c3f3066945ae49c612d3a52e6496b26a9d55193 (patch)
tree617396369c5d6089d5b7fcb54b147df23339959d
parent4048b6bf6ceac02c0b1e8c787317070a3fffa2a7 (diff)
Apply SDL:enum->number on keysyms.
-rw-r--r--2d/game-loop.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/2d/game-loop.scm b/2d/game-loop.scm
index f2faf13..92d3796 100644
--- a/2d/game-loop.scm
+++ b/2d/game-loop.scm
@@ -73,9 +73,12 @@
"Calls the relevant callback for the event."
(case (SDL:event:type e)
((SDL_KEYDOWN)
- (key-down-callback (SDL:event:key:keysym:sym e)))
+ (key-down-callback (event-keycode e)))
((SDL_KEYUP)
- (key-up-callback (SDL:event:key:keysym:sym e)))))
+ (key-up-callback (event-keycode e)))))
+
+(define (event-keycode e)
+ (SDL:enum->number SDL:event-keys (SDL:event:key:keysym:sym e)))
;;;
;;; Update and Render