<div dir="ltr">Ahh, I thought they were bound together in some sort of a mysterious structure. Thanks.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 25, 2014 at 4:53 PM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When you press a key, say A, and then release it, there are two<br>
key-events that are registered. The first has "get-key-code" as #\A.<br>
The second has "get-key-code" 'release and #\A is returned by<br>
get-release-key-code.<br>
<br>
Jay<br>
<div><div class="h5"><br>
On Tue, Feb 25, 2014 at 5:49 PM, Tom Dean <<a href="mailto:tld@google.com">tld@google.com</a>> wrote:<br>
> If I create an instance of  canvas% or editor-canvas% like<br>
><br>
> (define THE-CANVAS (new (class editor-canvas%<br>
>                                (super-new)<br>
>                                ;; Key handler for key-stroke input:<br>
>                                (define/override (on-char key-event)<br>
>                                  (let ([event (send key-event<br>
> get-key-code)])<br>
>                                    (printf "EQ? ~s~n" (eq? event #\[)))))))<br>
><br>
> and then hit the [  key it's as though the event is a pair consisting of a<br>
> char #\[ and the symbol 'release:<br>
><br>
> EQ? #t<br>
> EQ? #f<br>
><br>
> bur event isn't a pair?, list? or any other type as far as I can tell. And<br>
> it doesn't appear that get-key-code is returning multiple values, at least<br>
> in the sense of being something I can capture with let-values or set-values.<br>
> Any clues how I might capture just the key code and not the release symbol?<br>
><br>
><br>
</div></div>> ____________________<br>
>   Racket Users list:<br>
>   <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
</font></span></blockquote></div><br></div>