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) (send receiver get-editor)
receiver) receiver)
event)) event))
;; (printf "user-key? ~s\n" user-key?) returns #t ;; (printf "user-key? ~s\n" user-key?)
;; for key release events -- is this a problem? (we'll find out!)
(or user-key? (or user-key?
(super on-subwindow-char receiver event))) (super on-subwindow-char receiver event)))

View File

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