forsyth20121205-174063a80cc13 years agoHistory
58 lines · 2.3 KB · Text
RawDownload
.TH GRAB 9.SH NAMEgrab \- Confine pointer and keyboard events to a window sub-tree.SH SYNOPSIS\f5grab \fIwhat \fR?\fIarg arg \fR...?.SH DESCRIPTIONThis command implements simple pointer grabbing for Tk.When a grab is set for a particular window, Tk restricts all pointerevents to the grab window and its descendants in Tk's window hierarchy.Whenever the pointer is within the grab window's subtree, the pointerwill behave exactly the same as if there had been no grab at alland all events will be reported in the normal fashion.When the pointer is outside \fIwindow\fR's tree, button presses andreleases andmouse motion events are reported to \fIwindow\fR, and window entryand window exit events are ignored.The grab subtree ``owns'' the pointer:windows outside the grab subtree will be visible on the screenbut they will be insensitive until the grab is released.The tree of windows underneath the grab window can include top-levelwindows, in which case all of those top-level windowsand their descendants will continue to receive mouse eventsduring the grab..PPA grab locks out all applications on the screen,so that only the given subtree of the grabbing application will besensitive to pointer events (mouse button presses, mouse button releases,pointer motions, window entries, and window exits).During grabs the window manager will not receive pointerevents either (which means that if the grab is not releasedthe whole GUI will freeze, so be careful!)..PPThe \f5grab\fR command can take any of the following forms:.TP\f5grab release \fIwindow\fRReleases the grab on \fIwindow\fR if there is one, otherwise doesnothing.  Returns an empty string..TP\f5grab set \fIwindow\fRIf a grab was already in effect for this application on\fIwindow\fR's display then it is automatically released.If there is already a grab on \fIwindow\fR then the commanddoes nothing.  Returns an empty string..TP\f5grab ifunset \fIwindow\fRSame as.B grab setexcept that \fIwindow\fR is only grabbed if there is noother grab currently in effect..TP\f5grab status \fIwindow\fRReturns \f5none\fR if no grab is currently set on \fIwindow\fR,or\fIwindow\fR if it has the grab..SH BUGSThe current application-exclusive nature of.B grabis a problem which will be adressed in the future.