Altered keymap% to not claim to handle key events that it doesn't

Previously, `keymap%` would return #t for all shift, ctrl, and key release
events. DrRacket's editors would then not handle those events (correctly,
as they shouldn't handle already-handled events), meaning that the events
weren't sent to any snips.
This commit is contained in:
Neil Toronto 2014-08-29 16:37:47 -04:00
parent 82dca13f97
commit 8ba8d01ec0
2 changed files with 7 additions and 7 deletions

View File

@ -231,8 +231,7 @@
(send receiver get-editor)
receiver)
event))
;; (printf "user-key? ~s\n" user-key?) returns #t
;; for key release events -- is this a problem? (we'll find out!)
;; (printf "user-key? ~s\n" user-key?)
(or user-key?
(super on-subwindow-char receiver event)))

View File

@ -457,11 +457,12 @@
(def/public (handle-key-event [any? obj] [key-event% event])
(let ([code (send event get-key-code)])
(or (eq? code 'shift)
(if (or (eq? code 'shift)
(eq? code 'rshift)
(eq? code 'control)
(eq? code 'rcontrol)
(eq? code 'release)
(eq? code 'release))
prefixed?
(let ([score (get-best-score
code
(send event get-other-shift-key-code)