After computing the next window, Tk:focus-next examines the window's :takefocus option to see whether it should be skipped. If so, Tk:focus-next continues on to the next window in the focus order, until it eventually finds a window that will accept the focus or returns back to window.
Tk:focus-prev is similar to Tk:focus-next except that it returns the window just before window in the focus order.
Tk:focus-follows-mouse changes the focus model for the application to an implicit one where the window under the mouse gets the focus. After this procedure is called, whenever the mouse enters a window Tk will automatically give it the input focus. The focus command may be used to move the focus to a window other than the one under the mouse, but as soon as the mouse moves into a new window the focus will jump to that window. Note: at present there is no built-in support for returning the application to an explicit focus model; to do this you'll have to write a script that deletes the bindings created by Tk:focus-follows-mouse.
Tk:focus-on and Tk:focus-off are simpy defined as
(define Tk:focus-on (lambda (w) #t)) (define Tk:focus-off (lambda (w) #f))This procedures can be used by the focus traversal algorithm presented in the options manual page.