A little more digging, and here’s some more info; I’m hoping this will be
enough for the maintainers of 2htdp/universe to track down what’s going on.
In 2htdp/private/check-aux.rkt in the htdp-lib package, I opened a REPL and ran
> (require racket/gui)
> (define f
(let ([es (make-eventspace)])
(parameterize ([current-eventspace es])
(new (class frame%
(define/override (on-subwindow-char r e)
(define ps (key-event->parts e))
(if (equal? ps "release")
(printf "released ~a~%" (key-release->parts e))
(printf "pressed ~a~%" ps)))
> (define p (new panel%
> (send f show #t)
Then, with focus on the frame I created, I:
This triggered the messages:
I wrote the above class definition as I did, because I see that 2htdp/world.rkt
uses that technique (checking the output of key-event->parts) to tell if it’s
got a key release. What I’ve observed is that if one shift key is released
while the other is held down, the key event's get-key-code method is producing
the symbol 'shift or 'rshift, not 'release as the universe library expects.
So it appears that this is a bug originating down where the key-event% is being
instantiated in the MrEd library layer, which is a bit beyond the depth I can
troubleshoot in the time I have. I’ve created an issue on Github
<https://github.com/racket/gui/issues/91>, and will leave it at that.
Hope this helps.
> On Dec 17, 2017, at 18:45, Alex Harsanyi <alexharsa...@gmail.com> wrote:
> I tested this on a Windows platform and have the same result. It seems there
> is a problem in Racket with handling the right shift key: pressing down the
> right shift key results in "keydown" being invoked with a "rshift" argument,
> but releasing the right shift key results in "keyup" being called with a
> "shift" argument (instead of "rshift")
> Best Regards,
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com
> For more options, visit https://groups.google.com/d/optout
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.