[racket] puzzled by what (send key-event get-key-code) returns

From: Tom Dean (tld at google.com)
Date: Tue Feb 25 19:49:33 EST 2014

If I create an instance of  canvas% or editor-canvas% like

(define THE-CANVAS (new (class editor-canvas%
                               (super-new)
                               ;; Key handler for key-stroke input:
                               (define/override (on-char key-event)
                                 (let ([event (send key-event
get-key-code)])
                                   (printf "EQ? ~s~n" (eq? event #\[)))))))

and then hit the [  key it's as though the event is a pair consisting of a
char #\[ and the symbol 'release:

EQ? #t
EQ? #f

bur event isn't a pair?, list? or any other type as far as I can tell. And
it doesn't appear that get-key-code is returning multiple values, at least
in the sense of being something I can capture with let-values orset-values. Any
clues how I might capture just the key code and not the release symbol?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140225/a4222625/attachment.html>

Posted on the users mailing list.