summaryrefslogtreecommitdiff
path: root/chickadee.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee.scm')
-rw-r--r--chickadee.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 3c10880..73aeae9 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -25,6 +25,7 @@
#:use-module (sdl2)
#:use-module (sdl2 events)
#:use-module (sdl2 input game-controller)
+ #:use-module ((sdl2 input keyboard) #:prefix sdl2:)
#:use-module (sdl2 input joystick)
#:use-module (sdl2 input text)
#:use-module (sdl2 mixer)
@@ -36,10 +37,20 @@
#:use-module (chickadee render gl)
#:use-module (chickadee render gpu)
#:use-module (chickadee render viewport)
- #:export (current-window
+ #:export (key-pressed?
+ key-released?
+ current-window
run-game)
#:re-export (abort-game))
+(define (key-pressed? key)
+ "Return #t if KEY is currently being pressed."
+ (sdl2:key-pressed? key))
+
+(define (key-released? key)
+ "Return #t if KEY is not currently being pressed."
+ (sdl2:key-released? key))
+
(define *controllers* (make-hash-table))
(define (lookup-controller joystick-id)