[plt-scheme] Re: MrEd - Animated canvas

Laurent Ouaibou at gmail.com
Wed Mar 7 09:42:46 EST 2007


With your idea, the flutters disappeared. It is super, thank you:)

Now, I seek how to associate events keyboard to an action. But my code
doesn't want to work :

(define my-canvas%
  (class canvas%
    (define/override (on-char evt)
      (case (send evt get-key-code))
        ((left) (printf "left\n"))
        ((right) (printf "right\n"))
        (else (printf "Another key\n")))
    (super-new)))

Moreover, it is necessary to click in the canvas in order to events
keyboards start.

I don't understand why ?

Thanks,
Laurent



More information about the plt-scheme mailing list