Confine pointer and keyboard events to a window
Arguments:
Action - an grab action such as 'set' or 'remove' to take on the window (described below).
WindowName - a standard path-like name used to name the window.
DESCRIPTION
This function implements simple pointer and keyboard grabs for TK. When a grab is set for a particular window, TK restricts all pointer events to the grab window and its descendants in TK's window hierarchy. Whenever the pointer is within the grab window's subtree, the pointer will behave exactly the same as if there had been no grab at all and all events will be reported in the normal fashion. When the pointer is outside window's tree, button presses and releases and mouse motion events are reported to window, and window entry and window exit events are ignored. The grab subtree "owns" the pointer: windows outside the grab subtree will be visible on the screen but they will be insensitive until the grab is released. The tree of windows underneath the grab window can include top-level windows, in which case all of those top-level windows and their descendants will continue to receive mouse events during the grab.
The following ACTIONS are allowed by setting the value of the Action argument:
set
This is the default action and does not need to be specified.
Sets a grab on window. If a another grab was already in effect for this
application on window's display then it is automatically released. If there
is already a grab on window WindowName, then the command does nothing. Returns
an empty string.
current
The command returns the name of the window grabbed by this
application, or an empty string if the application has no grabs.
release
Releases the grab on WindowName if there is one, otherwise
does nothing. Returns an empty string.
status
Returns none if no grab is currently set on WindowName, local
if a grab is set on WindowName.