TIP #204: VIRTUAL EVENTS FOR KEYBOARD TRAVERSAL ================================================= Version: $Revision: 1.5 $ Author: Joe English State: Final Type: Project Tcl-Version: 8.5 Vote: Done Created: Monday, 21 June 2004 URL: https://tip.tcl-lang.org204.html Post-History: ------------------------------------------------------------------------- ABSTRACT ========== Proposes using two new virtual events, *<>* and *<>*, to notify widgets of keyboard navigation events. RATIONALE =========== Certain widgets need to perform some action when they receive and/or lose keyboard focus because of keyboard traversal. For example, tabbing into an Entry or Spinbox widget selects the widget contents. This cannot be done with a binding, since widgets may receive events for reasons other than keyboard traversal. Tk currently implements this feature with special-case logic that checks the target window's widget class in the /tk::TabToWindow/ procedure. The drawback to this approach is that it only works for the built-in widgets; third party widget sets like BWidget[], IWidgets[], and Tile[] must implement their own workarounds. PROPOSAL ========== Change the standard Tk bindings for and to do the following: * Send a *<>* virtual event to the current focus window, if any; * Set the focus to the new window; * Send a *<>* virtual event to the new window. Additionally, move the current code to handle traversal to Entry and Spinbox widgets from /tk::TabToWindow/ to class bindings. IMPLEMENTATION ================ See Tk Patch #976928[]. The BWidget package has used an identical scheme since version 1.7; see Tcllib bug #720032[] for details. COPYRIGHT =========== This document has been placed in the public domain. ------------------------------------------------------------------------- TIP AutoGenerator - written by Donal K. Fellows