From a59a6579c49d8acb0c328316844befe8ea3379ce Mon Sep 17 00:00:00 2001 From: David Thompson Date: Tue, 25 Jun 2013 19:50:16 -0400 Subject: Update simple example program. --- examples/simple.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/simple.scm b/examples/simple.scm index dd09cb0..f65a14c 100644 --- a/examples/simple.scm +++ b/examples/simple.scm @@ -4,17 +4,17 @@ (2d game-loop) (2d window) (2d input) + (2d helpers) (ice-9 format)) (define window-width 800) (define window-height 600) (define sprite #f) -(define (key-down key) - (cond ((or (= key (keycode escape)) - (= key (keycode q))) - (close-window) - (quit)))) +(define (key-down key mod unicode) + (cond ((any-equal? key (keycode escape) (keycode q)) + (close-window) + (quit)))) ;; Draw our sprite (define (render) @@ -22,7 +22,7 @@ ;; Register callbacks. (set-render-callback (lambda () (render))) -(set-key-down-callback (lambda (key) (key-down key))) +(set-key-down-callback (lambda (key mod unicode) (key-down key mod unicode))) ;; Open the window. (open-window window-width window-height) -- cgit v1.2.3