on-traverse-char in top-level-window<%>
Attempts to handle the given keyboard event as a navigation event, such
as a Tab key event that moves the keyboard focus. If the event is
handled, #t is returned, otherwise #f is returned.
(-> booleansenda-top-level-windowon-traverse-charevent)
event:key-event%objectThe following rules determine, in order, whether and how
eventis handled:If the window that currently owns the focus specifically handles the event, then
#fis returned. The following describes window types and the keyboard events they specifically handle:editor-canvas%-- tab-exit is disabled (seeallow-tab-exit): all keyboard events, except alphanumeric key events when the Meta (X) or Alt (Windows) key is pressed; when tab-exit is enabled: all keyboard events except Tab, Enter, Escape, and alphanumeric Meta/Alt events.canvas%-- when tab-focus is disabled (seeaccept-tab-focus): all keyboard events, except alphanumeric key events when the Meta (X) or Alt (Windows) key is pressed; when tab-focus is enabled: no key eventstext-field%,'singlestyle -- arrow key events and alphanumeric key events when the Meta (X) or Alt (Windows) key is not pressed (and all alphanumeric events under Mac OS X)text-field%,'multiplestyle -- all keyboard events, except alphanumeric key events when the Meta (X) or Alt (Windows) key is pressedchoice%-- arrow key events and alphanumeric key events when the Meta (X) or Alt (Windows) key is not pressedlist-box%-- arrow key events and alphanumeric key events when the Meta (X) or Alt (Windows) key is not pressed
If
eventis a Tab or arrow key event, the keyboard focus is moved within the window and#tis returned. Across platforms, the types of windows that accept the keyboard focus via navigation may vary, buttext-field%windows always accept the focus, andmessage%,gauge%, andpanel%windows never accept the focus.If
eventis a Space key event and the window that currently owns the focus is abutton%,check-box%, orradio-box%object, the event is handled in the same way as a click on the control and#tis returned.If
eventis an Enter key event and the current top-level window contains a border button, the button's callback is invoked and#tis returned. (The'borderstyle for abutton%object indicates to the user that pressing Enter is the same as clicking the button.) If the window does not contain a border button,#tis returned if the window with the current focus is not a text field or editor canvas.In a dialog, if
eventis an Escape key event, the event is handled the same as a click on the dialog's close box (i.e., the dialog'scan-close?andon-closemethods are called, and the dialog is hidden) and#tis returned.If
eventis an alphanumeric key event and the current top-level window contains a control with a mnemonic matching the key (which is installed via a label that contains ``&''; seeget-labelfor more information), then the keyboard focus is moved to the matching control. Furthermore, if the matching control is abutton%,check-box%, orradio-box%button, the keyboard event is handled in the same way as a click on the control.Otherwise,
#fis returned.