Hint #2 -- Self documenting controls...
If you add a few extra fields (components) to your key specifications, you can use it to document the controls for the user:
(store (object [tag 'key] [key "F1"] [do (λ (e) (:= SV.helping (not SV.helping)))] [label "help"] [help "Show/dismiss control help screen."])) (store (object [tag 'key] [key "ArrowLeft"] [do key-left] [label "left"] [help "Press to go left."]))
Then add a function to display it when you render:
(define (draw-help cx) "( cx --) Show controls help." (let* ([qw (/ SV.screen.width 4)] [qh (/ SV.screen.height 4)] [x (+ qw 32)] [y (+ qh 32)]) (:= cx 'globalAlpha 0.75) (cx.fillRect qw qh (* 2 qw) (* 2 qh)) (:= cx 'globalAlpha 1.0) (:= cx 'fillStyle 'white) (:= cx 'font "Bold 16px sans-serif") (cx.fillText "CONTROL HELP" x y) (+= y 32) (:= cx 'font "12px sans-serif") (for ([k in-array (qq 'key)]) (cx.fillText k.key x y) (cx.fillText k.label (+ x 80) y) (cx.fillText k.help (+ x 128) y) (+= y 16)) ))
Now, when I press [F1], I see this:
One of the great things about this is that if you're using the overlay system, the help will update to whatever keys you currently have assigned.
Just thought of this when wiring up the keys for my own entry and thought I'd share!