change `text-field%' to treat numpad Enter like normal Enter/Return

Closes PR 7890

original commit: 3ff7ca2d317396d3747b3c6dab35c5e29aac95ea
This commit is contained in:
Matthew Flatt 2011-01-18 07:30:36 -07:00
parent f6ab871af9
commit 7c2da93eb0
2 changed files with 4 additions and 2 deletions

View File

@ -90,7 +90,9 @@
(entry-point
(lambda (e)
(let ([c (send e get-key-code)])
(unless (and (or (eq? c #\return) (eq? c #\newline))
(unless (and (or (eq? c #\return)
(eq? c #\newline)
(eq? c #\u3)) ; numpad enter
return-cb
(return-cb (lambda () (callback 'text-field-enter) #t)))
(as-exit (lambda () (super-on-char e)))))))]

View File

@ -10,7 +10,7 @@ A @scheme[text-field%] object is an editable text field with an
@itemize[
@item{A single line of text is visible, and a special control event
is generated when the user presses Enter (when the text field has the
is generated when the user presses Return or Enter (when the text field has the
focus) and the event is not handled by the text field's frame or
dialog (see @xmethod[top-level-window<%> on-traverse-char] ).}