Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get-key-release-code returns 'shift instead of 'rshift #236

Open
default-kramer opened this issue Aug 4, 2021 · 1 comment
Open

get-key-release-code returns 'shift instead of 'rshift #236

default-kramer opened this issue Aug 4, 2021 · 1 comment

Comments

@default-kramer
Copy link

When I press the right shift key, get-key-code produces 'rshift, but when I release the same key it produces 'shift. I think get-key-release-code should return 'rshift in this situation.

This is on Windows using DrRacket, version 8.0.0.11--2021-03-15(c0cfd32/a) [cs].

Possibly related to #91

@default-kramer
Copy link
Author

Just retested on Racket 8.2 CS to make sure the issue is still present. A test program:

#lang racket/gui

(define my-frame%
  (class frame%
    (super-new)
    (define/override (on-subwindow-char receiver key-event)
      (let* ([code (send key-event get-key-code)]
             [release-code (send key-event get-key-release-code)]
             [shift? (send key-event get-shift-down)])
        (println (list code release-code shift?))))))

(define f (new my-frame% [label "Test"] [min-width 100] [min-height 100]))
(send f show #t)

When I press and release right shift, I get '(rshift press #t) '(release shift #f), but I think it would be more correct if it were '(rshift press #t) '(release rshift #f).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant