head	1.32;
access;
symbols
	core-8-5-9:1.29.2.1
	core-8-5-8:1.29.2.1
	macosx-cocoa-merge:1.32
	macosx-cocoa-premerge:1.32
	macosx-carbon-freeze:1.32
	core-8-5-7:1.29.2.1
	core-8-5-6:1.29
	core-8-6-b1:1.31
	core-8-6-a3:1.31
	core-8-5-5:1.29
	core-8-6-a2:1.30
	core-8-5-4:1.29
	core-8-5-3:1.29
	core-8-6-a1:1.29
	core-8-4-19:1.7.2.2
	core-8-5-branch:1.29.0.2
	core-8-5-2:1.29
	core-8-4-18:1.7.2.2
	core-8-5-1:1.29
	core-8-4-17:1.7.2.2
	core-8-5-0:1.29
	core-8-5-b3:1.28
	core-8-5-b2:1.24
	core-8-4-16:1.7.2.2
	core-8-5-b1:1.20
	core-stablilizer-merge:1.20
	core-stabilizer-branch:1.20.0.2
	core-stabilizer-merge:1.29
	core-8-4-15:1.7.2.2
	core-8-5-a6:1.20
	core-8-5-a5:1.19
	core-8-4-14:1.7.2.2
	core-8-5-a4:1.19
	core-8-4-13:1.7.2.2
	core-8-4-12:1.7.2.2
	core-8-4-11:1.7.2.2
	core-8-5-a3:1.19
	core-8-4-10:1.7.2.2
	core-8-4-9-branch:1.7.2.2.0.2
	core-8-5-a2:1.18
	core-8-4-9:1.7.2.2
	core-8-4-8:1.7.2.2
	core-8-4-7:1.7.2.1
	core-8-5-a1:1.10
	core-8-4-6:1.7.2.1
	core-8-4-5:1.7
	mistachkin-dev-branch:1.9.0.2
	core-8-4-4:1.7
	core-8-4-3:1.7
	core-8-4-branch:1.7.0.2
	core-8-4-2:1.7
	core-8-4-1:1.7
	core-8-3-5:1.3.18.1
	core-8-4-0:1.6
	macosx-8-4-merge-2002-08-31-trunk:1.6
	macosx-8-4-premerge-2002-08-31-branch:1.5.6.1
	macosx-8-4-premerge-2002-08-31-trunk:1.6
	macosx-8-4-merge-2002-08-30-branch:1.5.6.1
	macosx-8-4-merge-2002-08-30-trunk:1.6
	macosx-8-4-merge-2002-08-20-branch:1.5.6.1
	macosx-8-4-merge-2002-08-20-trunk:1.6
	core-8-4-b2:1.6
	core-8-4-b1:1.6
	macosx-premerge-6-9-02:1.5
	core-8-4-a4:1.5
	core-8-3-4:1.3.18.1
	macosx-8-4-branch:1.5.0.6
	macosx-8-4-branchpoint:1.5
	core-8-4-a3:1.5
	core-8-3-3:1.3.18.1
	dgp-privates-into-namespace:1.5.0.4
	tclpro-1-5-0:1.3
	core-8-4-win-speedup:1.5.0.2
	core-8-4-a2:1.5
	tclpro-1-4-1:1.3
	tclpro-1-4-0:1.3
	core-8-3-2:1.3
	ajuba-ajuba2-2-1-base:1.3
	ajuba-ajuba2-2-0:1.3
	core-8-4-a1:1.5
	core-8-3-1-branch:1.3.0.18
	core-8-3-1:1.3
	scriptics-sc-2-0-b5:1.3
	scriptics-sc-2-0-fixed:1.3
	scriptics-sc-2-0-b2:1.3
	scriptics-sc-2-0-b1:1.3
	core-8-3-0:1.3
	core-8-3-b2:1.3
	core-8-3-b1:1.3
	scriptics-sc-1-1:1.3
	scriptics-sc-1-1-b1:1.3
	core-8-2-3:1.3
	scriptics-sc-1-1-branch:1.3.0.16
	scriptics-sc-1-1-base:1.3
	scriptics-sc-1-0:1.3
	scriptics-sc-1-0-branch:1.3.0.14
	scriptics-sc-1-0-base:1.3
	core-8-2-2:1.3
	core-8-2-1:1.3
	scriptics-bc-1-0-b1:1.3
	core-8-2-1-branch:1.3.0.12
	scriptics-tclpro-1-3-0:1.3
	core-8-2-0:1.3
	core-8-2-b3-branch:1.3.0.10
	core-8-2-b3-base:1.3
	scriptics-tclpro-1-3-b4:1.3
	core-8-2-b2:1.3
	scriptics-tclpro-1-3-b3:1.3
	core-8-2-b1:1.3
	scriptics-tclpro-1-3-b2:1.3
	merge-to-mainline-5/21/99:1.3
	scriptics-tclpro-1-3-b2-branch:1.3.0.8
	core-8-1-1:1.3
	scriptics-tclpro-1-3-b1:1.3
	core-8-1-1-base:1.3
	core-8-1-0:1.3
	merge-to-mainline-4-29-99:1.3
	merge-to-mainline-4-23-99:1.3
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.3.0.6
	core-8-0-6-base:1.3
	core-8-0-5:1.3
	core-8-1-b3:1.1.4.2
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.3.0.4
	scriptics-tclpro-1-2:1.3
	scriptics-tclpro-1-2-b2:1.3
	core-8-1-merge-2/10/99:1.3
	core-8-0-5-branch:1.3.0.2
	core-8-0-5-base:1.3
	scriptics-tclpro-1-2-b1:1.3
	scriptics-tclpro-1-2-a1:1.3
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.3
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.32
date	2009.01.03.00.05.19;	author ferrieux;	state Exp;
branches;
next	1.31;

1.31
date	2008.09.23.13.36.36;	author dkf;	state Exp;
branches;
next	1.30;

1.30
date	2008.06.30.22.57.02;	author dkf;	state Exp;
branches;
next	1.29;

1.29
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches
	1.29.2.1;
next	1.28;

1.28
date	2007.11.01.23.03.54;	author dkf;	state Exp;
branches;
next	1.27;

1.27
date	2007.11.01.11.33.37;	author das;	state Exp;
branches;
next	1.26;

1.26
date	2007.11.01.10.35.12;	author dkf;	state Exp;
branches;
next	1.25;

1.25
date	2007.10.29.16.04.13;	author dkf;	state Exp;
branches;
next	1.24;

1.24
date	2007.10.26.20.13.23;	author dgp;	state Exp;
branches;
next	1.23;

1.23
date	2007.10.26.12.25.38;	author dkf;	state Exp;
branches;
next	1.22;

1.22
date	2007.10.24.14.32.57;	author dkf;	state Exp;
branches;
next	1.21;

1.21
date	2007.10.16.15.11.36;	author dkf;	state Exp;
branches;
next	1.20;

1.20
date	2006.11.15.13.29.17;	author dkf;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2005.04.06.21.11.54;	author dkf;	state Exp;
branches;
next	1.18;

1.18
date	2004.10.28.10.22.51;	author dkf;	state Exp;
branches;
next	1.17;

1.17
date	2004.08.29.09.27.35;	author dkf;	state Exp;
branches;
next	1.16;

1.16
date	2004.08.20.10.56.36;	author dkf;	state Exp;
branches;
next	1.15;

1.15
date	2004.07.05.21.21.52;	author dkf;	state Exp;
branches;
next	1.14;

1.14
date	2004.06.21.19.32.54;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2004.06.21.19.31.51;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2004.05.23.20.51.51;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2004.04.23.13.47.46;	author dkf;	state Exp;
branches;
next	1.10;

1.10
date	2004.01.09.22.26.24;	author pspjuth;	state Exp;
branches;
next	1.9;

1.9
date	2003.09.13.20.27.32;	author jenglish;	state Exp;
branches;
next	1.8;

1.8
date	2003.08.19.19.08.08;	author jenglish;	state Exp;
branches;
next	1.7;

1.7
date	2002.09.30.09.35.39;	author dkf;	state Exp;
branches
	1.7.2.1;
next	1.6;

1.6
date	2002.06.14.22.25.11;	author jenglish;	state Exp;
branches;
next	1.5;

1.5
date	2000.05.23.00.31.36;	author hobbs;	state Exp;
branches
	1.5.6.1;
next	1.4;

1.4
date	2000.04.27.18.28.54;	author ericm;	state Exp;
branches;
next	1.3;

1.3
date	98.10.10.00.30.35;	author rjohnson;	state Exp;
branches
	1.3.18.1;
next	1.2;

1.2
date	98.09.14.18.22.54;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.39.49;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.16.11;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.11.25.21.16.29;	author stanton;	state Exp;
branches;
next	;

1.3.18.1
date	2001.04.04.07.23.48;	author hobbs;	state Exp;
branches;
next	;

1.5.6.1
date	2002.08.20.20.27.00;	author das;	state Exp;
branches;
next	;

1.7.2.1
date	2004.02.16.23.20.02;	author wolfsuit;	state Exp;
branches;
next	1.7.2.2;

1.7.2.2
date	2004.10.28.10.19.29;	author dkf;	state Exp;
branches;
next	;

1.20.2.1
date	2007.10.17.14.37.05;	author dgp;	state Exp;
branches;
next	1.20.2.2;

1.20.2.2
date	2007.11.01.16.37.13;	author dgp;	state Exp;
branches;
next	1.20.2.3;

1.20.2.3
date	2007.11.02.14.51.39;	author dgp;	state Exp;
branches;
next	;

1.29.2.1
date	2009.01.03.00.18.08;	author ferrieux;	state Exp;
branches;
next	;


desc
@@


1.32
log
@Fix incorrect statement about %-substituees quoting.
@
text
@'\"
'\" Copyright (c) 1990 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 1998 by Scriptics Corporation.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: bind.n,v 1.31 2008/09/23 13:36:36 dkf Exp $
'\" 
.so man.macros
.TH bind n 8.0 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
bind \- Arrange for X events to invoke Tcl scripts
.SH SYNOPSIS
\fBbind\fI tag\fR ?\fIsequence\fR? ?\fB+\fR??\fIscript\fR?
.BE
.SH "INTRODUCTION"
.PP
The \fBbind\fR command associates Tcl scripts with X events.
If all three arguments are specified, \fBbind\fR will
arrange for \fIscript\fR (a Tcl script) to be evaluated whenever
the event(s) given by \fIsequence\fR occur in the window(s)
identified by \fItag\fR.
If \fIscript\fR is prefixed with a
.QW + ,
then it is appended to
any existing binding for \fIsequence\fR;  otherwise \fIscript\fR replaces
any existing binding.
If \fIscript\fR is an empty string then the current binding for
\fIsequence\fR is destroyed, leaving \fIsequence\fR unbound.
In all of the cases where a \fIscript\fR argument is provided,
\fBbind\fR returns an empty string.
.PP
If \fIsequence\fR is specified without a \fIscript\fR, then the
script currently bound to \fIsequence\fR is returned, or
an empty string is returned if there is no binding for \fIsequence\fR.
If neither \fIsequence\fR nor \fIscript\fR is specified, then the
return value is a list whose elements are all the sequences
for which there exist bindings for \fItag\fR.
.PP
The \fItag\fR argument determines which window(s) the binding applies to.
If \fItag\fR begins with a dot, as in \fB.a.b.c\fR, then it must
be the path name for a window; otherwise it may be an arbitrary
string.
Each window has an associated list of tags, and a binding applies
to a particular window if its tag is among those specified for
the window.
Although the \fBbindtags\fR command may be used to assign an
arbitrary set of binding tags to a window, the default binding
tags provide the following behavior:
.IP \(bu 3
If a tag is the name of an internal window the binding applies
to that window.
.IP \(bu 3
If the tag is the name of a toplevel window the binding applies
to the toplevel window and all its internal windows.
.IP \(bu 3
If the tag is the name of a class of widgets, such as \fBButton\fR,
the binding applies to all widgets in that class;
.IP \(bu 3
If \fItag\fR has the value \fBall\fR,
the binding applies to all windows in the application.
.SH "EVENT PATTERNS"
.PP
The \fIsequence\fR argument specifies a sequence of one or more
event patterns, with optional white space between the patterns.  Each
event pattern may
take one of three forms.  In the simplest case it is a single
printing ASCII character, such as \fBa\fR or \fB[\fR.  The character
may not be a space character or the character \fB<\fR.  This form of
pattern matches a \fBKeyPress\fR event for the particular
character.  The second form of pattern is longer but more general.
It has the following syntax:
.CS
\fB<\fImodifier\-modifier\-type\-detail\fB>\fR
.CE
The entire event pattern is surrounded by angle brackets.
Inside the angle brackets are zero or more modifiers, an event
type, and an extra piece of information (\fIdetail\fR) identifying
a particular button or keysym.  Any of the fields may be omitted,
as long as at least one of \fItype\fR and \fIdetail\fR is present.
The fields must be separated by white space or dashes.
.PP
The third form of pattern is used to specify a user-defined, named virtual
event.  It has the following syntax:
.CS
\fB<<\fIname\fB>>\fR
.CE
The entire virtual event pattern is surrounded by double angle brackets.
Inside the angle brackets is the user-defined name of the virtual event.
Modifiers, such as \fBShift\fR or \fBControl\fR, may not be combined with a
virtual event to modify it.  Bindings on a virtual event may be created
before the virtual event is defined, and if the definition of a virtual
event changes dynamically, all windows bound to that virtual event will
respond immediately to the new definition.
.PP
Some widgets (e.g. \fBmenu\fR and \fBtext\fR) issue virtual events
when their internal state is updated in some ways.  Please see the
manual page for each widget for details.
.SS "MODIFIERS"
.PP
Modifiers consist of any of the following values:
.DS
.ta 6c
\fBControl\fR	\fBMod1\fR, \fBM1\fR, \fBCommand\fR
\fBAlt\fR	\fBMod2\fR, \fBM2\fR, \fBOption\fR
\fBShift\fR	\fBMod3\fR, \fBM3\fR
\fBLock\fR	\fBMod4\fR, \fBM4\fR
\fBExtended\fR	\fBMod5\fR, \fBM5\fR
\fBButton1\fR, \fBB1\fR	\fBMeta\fR, \fBM\fR
\fBButton2\fR, \fBB2\fR	\fBDouble\fR
\fBButton3\fR, \fBB3\fR	\fBTriple\fR
\fBButton4\fR, \fBB4\fR	\fBQuadruple\fR
\fBButton5\fR, \fBB5\fR
.DE
Where more than one value is listed, separated by commas, the values
are equivalent.
Most of the modifiers have the obvious X meanings.
For example, \fBButton1\fR requires that
button 1 be depressed when the event occurs.
For a binding to match a given event, the modifiers in the event
must include all of those specified in the event pattern.
An event may also contain additional modifiers not specified in
the binding.
For example, if button 1 is pressed while the shift and control keys
are down, the pattern \fB<Control\-Button\-1>\fR will match
the event, but \fB<Mod1\-Button\-1>\fR will not.
If no modifiers are specified, then any combination of modifiers may
be present in the event.
.PP
\fBMeta\fR and \fBM\fR refer to whichever of the
\fBM1\fR through \fBM5\fR modifiers is associated with the Meta
key(s) on the keyboard (keysyms \fBMeta_R\fR and \fBMeta_L\fR).
If there are no Meta keys, or if they are not associated with any
modifiers, then \fBMeta\fR and \fBM\fR will not match any events.
Similarly, the \fBAlt\fR modifier refers to whichever modifier
is associated with the alt key(s) on the keyboard (keysyms
\fBAlt_L\fR and \fBAlt_R\fR).
.PP
The \fBDouble\fR, \fBTriple\fR and \fBQuadruple\fR modifiers are a
convenience for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be repeated 2, 3 or 4
times, and also place a time and space requirement on the sequence: for a
sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR
pattern, all of the events must occur close together in time and without
substantial mouse motion in between.  For example, \fB<Double\-Button\-1>\fR
is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space
requirement.
.PP
The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR
resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys.
.PP
The \fBExtended\fR modifier is, at present, specific to Windows.  It
appears on events that are associated with the keys on the
.QW "extended keyboard" .
On a US keyboard, the extended keys include the \fBAlt\fR
and \fBControl\fR keys at the right of the keyboard, the cursor keys
in the cluster to the left of the numeric pad, the \fBNumLock\fR key,
the \fBBreak\fR key, the \fBPrintScreen\fR key, and the \fB/\fR and
\fBEnter\fR keys in the numeric keypad.
.SS "EVENT TYPES"
.PP
The \fItype\fR field may be any of the standard X event types, with a
few extra abbreviations.  The \fItype\fR field will also accept a
couple non-standard X event types that were added to better support
the Macintosh and Windows platforms.  Below is a list of all the valid
types; where two names appear together, they are synonyms.
.DS
.ta \w'\fBButtonPress, Button\0\0\0\fR'u +\w'\fBKeyPress, Key\0\0\0\fR'u
\fBActivate\fR	\fBDestroy\fR	\fBMap\fR
\fBButtonPress\fR, \fBButton\fR	\fBEnter\fR	\fBMapRequest\fR
\fBButtonRelease\fR	\fBExpose\fR	\fBMotion\fR
\fBCirculate\fR	\fBFocusIn\fR	\fBMouseWheel\fR
\fBCirculateRequest\fR	\fBFocusOut\fR	\fBProperty\fR
\fBColormap\fR	\fBGravity\fR	\fBReparent\fR
\fBConfigure\fR	\fBKeyPress\fR, \fBKey\fR	\fBResizeRequest\fR
\fBConfigureRequest\fR	\fBKeyRelease\fR	\fBUnmap\fR
\fBCreate\fR	\fBLeave\fR	\fBVisibility\fR
\fBDeactivate\fR
.DE
Most of the above events have the same fields and behaviors as events
in the X Windowing system.  You can find more detailed descriptions of
these events in any X window programming book.  A couple of the events
are extensions to the X event system to support features unique to the
Macintosh and Windows platforms.  We provide a little more detail on
these events here.  These include:
.IP "\fBActivate\fR, \fBDeactivate\fR" 5
These two events are sent to every sub-window of a toplevel when they
change state.  In addition to the focus Window, the Macintosh platform
and Windows platforms have a notion of an active window (which often
has but is not required to have the focus).  On the Macintosh, widgets
in the active window have a different appearance than widgets in
deactive windows.  The \fBActivate\fR event is sent to all the
sub-windows in a toplevel when it changes from being deactive to
active.  Likewise, the \fBDeactive\fR event is sent when the window's
state changes from active to deactive.  There are no useful percent
substitutions you would make when binding to these events.
.IP \fBMouseWheel\fR 5
Many contemporary mice support a mouse wheel, which is used
for scrolling documents without using the scrollbars.  By rolling the
wheel, the system will generate \fBMouseWheel\fR events that the
application can use to scroll.  Like \fBKey\fR events the event is
always routed to the window that currently has focus. When the event
is received you can use the \fB%D\fR substitution to get the
\fIdelta\fR field for the event, which is a integer value describing how
the mouse wheel has moved.  The smallest value for which the
system will report is defined by the OS.  On Windows 95 & 98 machines
this value is at least 120 before it is reported.  However, higher
resolution devices may be available in the future.  The sign of the
value determines which direction your widget should scroll.  Positive
values should scroll up and negative values should scroll down.
.IP "\fBKeyPress\fR, \fBKeyRelease\fR" 5
The \fBKeyPress\fR and \fBKeyRelease\fR events are generated
whenever a key is pressed or released.  \fBKeyPress\fR and \fBKeyRelease\fR
events are sent to the window which currently has the keyboard focus.
.IP "\fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR" 5
The \fBButtonPress\fR and \fBButtonRelease\fR events
are generated when the user presses or releases a mouse button.
\fBMotion\fR events are generated whenever the pointer is moved.
\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are
normally sent to the window containing the pointer.
.RS
.PP
When a mouse button is pressed, the window containing the pointer
automatically obtains a temporary pointer grab.
Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR
events will be sent to that window,
regardless of which window contains the pointer,
until all buttons have been released.
.RE
.IP \fBConfigure\fR 5
A \fBConfigure\fR event is sent to a window whenever its
size, position, or border width changes, and sometimes
when it has changed position in the stacking order.
.IP "\fBMap\fR, \fBUnmap\fR" 5
The \fBMap\fR and \fBUnmap\fR events are generated whenever the mapping
state of a window changes.
.RS
.PP
Windows are created in the unmapped state.
Top-level windows become mapped when they transition to the
\fBnormal\fR state, and are unmapped in the \fBwithdrawn\fR
and \fBiconic\fR states.
Other windows become mapped when they are placed under control
of a geometry manager (for example \fBpack\fR or \fBgrid\fR).
.PP
A window is \fIviewable\fR only if it and all of its ancestors are mapped.
Note that geometry managers typically do not map their children until
they have been mapped themselves, and unmap all children
when they become unmapped; hence in Tk \fBMap\fR and \fBUnmap\fR
events indicate whether or not a window is viewable.
.RE
.IP \fBVisibility\fR 5
A window is said to be \fIobscured\fR when another window
above it in the stacking order fully or partially overlaps it.
\fBVisibility\fR events are generated whenever a window's
obscurity state changes; the \fIstate\fR field (\fB%s\fR)
specifies the new state.
.IP \fBExpose\fR 5
An \fBExpose\fR event is generated whenever all or part of a
window should be redrawn (for example, when a window is
first mapped or if it becomes unobscured).
It is normally not necessary for client applications to
handle \fBExpose\fR events, since Tk handles them internally.
.IP \fBDestroy\fR 5
A \fBDestroy\fR event is delivered to a window when
it is destroyed.
.RS
.PP
When the \fBDestroy\fR event is delivered
to a widget, it is in a
.QW half-dead
state: the widget still exists, but most operations on it will fail.
.RE
.IP "\fBFocusIn\fR, \fBFocusOut\fR" 5
The \fBFocusIn\fR and \fBFocusOut\fR events are generated
whenever the keyboard focus changes.
A \fBFocusOut\fR event is sent to the old focus window,
and a \fBFocusIn\fR event is sent to the new one.
.RS
.PP
In addition,
if the old and new focus windows do not share a common parent,
.QW "virtual crossing"
focus events are sent to the intermediate windows in the hierarchy.
Thus a \fBFocusIn\fR event indicates
that the target window or one of its descendants has acquired the focus,
and a \fBFocusOut\fR event indicates that the focus
has been changed to a window outside the target window's hierarchy.
.PP
The keyboard focus may be changed explicitly by a call to \fBfocus\fR,
or implicitly by the window manager.
.RE
.IP "\fBEnter\fR, \fBLeave\fR" 5
An \fBEnter\fR event is sent to a window when the pointer
enters that window, and a \fBLeave\fR event is sent when
the pointer leaves it.
.RS
.PP
If there is a pointer grab in effect, \fBEnter\fR and \fBLeave\fR
events are only delivered to the window owning the grab.
.PP
In addition, when the pointer moves
between two windows, \fBEnter\fR and \fBLeave\fR
.QW "virtual crossing"
events are sent to intermediate windows
in the hierarchy in the same manner as for \fBFocusIn\fR and
\fBFocusOut\fR events.
.RE
.IP \fBProperty\fR
A \fBProperty\fR event is sent to a window whenever an X property
belonging to that window is changed or deleted.
\fBProperty\fR events are not normally delivered to Tk applications as
they are handled by the Tk core.
.IP \fBColormap\fR
A \fBColormap\fR event is generated whenever the colormap
associated with a window has been changed, installed, or uninstalled.
.RS
.PP
Widgets may be assigned a private colormap by
specifying a \fB\-colormap\fR option; the window manager
is responsible for installing and uninstalling colormaps
as necessary.
.PP
Note that Tk provides no useful details for this event type.
.RE
'\" The following events were added in TIP#47
.IP "\fBMapRequest\fR, \fBCirculateRequest\fR, \fBResizeRequest\fR, \fBConfigureRequest\fR, \fBCreate\fR" 5
These events are not normally delivered to Tk applications.
They are included for completeness, to make it possible to
write X11 window managers in Tk.
(These events are only delivered when a client has
selected \fBSubstructureRedirectMask\fR on a window;
the Tk core does not use this mask.)
.IP "\fBGravity\fR, \fBReparent\fR, \fBCirculate\fR" 5
The events \fBGravity\fR and \fBReparent\fR
are not normally delivered to Tk applications.
They are included for completeness.
.RS
.PP
A \fBCirculate\fR event indicates that the window has moved
to the top or to the bottom of the stacking order as
a result of an \fBXCirculateSubwindows\fR protocol request.
Note that the stacking order may be changed for other reasons
which do not generate a \fBCirculate\fR event, and that
Tk does not use \fBXCirculateSubwindows()\fR internally.
This event type is included only for completeness;
there is no reliable way to track changes to a window's
position in the stacking order.
.RE
.SS "EVENT DETAILS"
.PP
The last part of a long event specification is \fIdetail\fR.  In the
case of a \fBButtonPress\fR or \fBButtonRelease\fR event, it is the
number of a button (1\-5).  If a button number is given, then only an
event on that particular button will match;  if no button number is
given, then an event on any button will match.  Note:  giving a
specific button number is different than specifying a button modifier;
in the first case, it refers to a button being pressed or released,
while in the second it refers to some other button that is already
depressed when the matching event occurs.  If a button
number is given then \fItype\fR may be omitted:  if will default
to \fBButtonPress\fR.  For example, the specifier \fB<1>\fR
is equivalent to \fB<ButtonPress\-1>\fR.
.PP
If the event type is \fBKeyPress\fR or \fBKeyRelease\fR, then
\fIdetail\fR may be specified in the form of an X keysym.  Keysyms
are textual specifications for particular keys on the keyboard;
they include all the alphanumeric ASCII characters (e.g.
.QW a
is the keysym for the ASCII character
.QW a ),
plus descriptions for non-alphanumeric characters
.PQ comma "is the keysym for the comma character" ,
plus descriptions for all the non-ASCII keys on the keyboard (e.g.
.QW Shift_L
is the keysym for the left shift key, and
.QW F1
is the keysym for the F1 function key, if it exists).  The
complete list of keysyms is not presented here;  it is
available in other X documentation and may vary from system to
system.
If necessary, you can use the \fB%K\fR notation described below
to print out the keysym name for a particular key.
If a keysym \fIdetail\fR is given, then the
\fItype\fR field may be omitted;  it will default to \fBKeyPress\fR.
For example, \fB<Control\-comma>\fR is equivalent to
\fB<Control\-KeyPress\-comma>\fR.
.SH "BINDING SCRIPTS AND SUBSTITUTIONS"
.PP
The \fIscript\fR argument to \fBbind\fR is a Tcl script,
which will be executed whenever the given event sequence occurs.
\fICommand\fR will be executed in the same interpreter that the
\fBbind\fR command was executed in, and it will run at global
level (only global variables will be accessible).
If \fIscript\fR contains
any \fB%\fR characters, then the script will not be
executed directly.  Instead, a new script will be
generated by replacing each \fB%\fR, and the character following
it, with information from the current event.  The replacement
depends on the character following the \fB%\fR, as defined in the
list below.  Unless otherwise indicated, the
replacement string is the decimal value of the given field from
the current event.
Some of the substitutions are only valid for
certain types of events;  if they are used for other types of events
the value substituted is undefined.
.IP \fB%%\fR 5
Replaced with a single percent.
.IP \fB%#\fR 5
The number of the last client request processed by the server
(the \fIserial\fR field from the event).  Valid for all event
types.
.IP \fB%a\fR 5
The \fIabove\fR field from the event,
formatted as a hexadecimal number.
Valid only for \fBConfigure\fR events.
Indicates the sibling window immediately below the receiving window
in the stacking order, or \fB0\fR if the receiving window is at the
bottom.
.IP \fB%b\fR 5
The number of the button that was pressed or released.  Valid only
for \fBButtonPress\fR and \fBButtonRelease\fR events.
.IP \fB%c\fR 5
The \fIcount\fR field from the event.  Valid only for \fBExpose\fR events.
Indicates that there are \fIcount\fR pending \fBExpose\fR events which have not
yet been delivered to the window.
.IP \fB%d\fR 5
The \fIdetail\fR or \fIuser_data\fR
field from the event.  The \fB%d\fR is replaced by
a string identifying the detail.  For \fBEnter\fR,
\fBLeave\fR, \fBFocusIn\fR, and \fBFocusOut\fR events,
the string will be one of the following:
.RS
.DS
.ta 6c
\fBNotifyAncestor\fR	\fBNotifyNonlinearVirtual\fR
\fBNotifyDetailNone\fR	\fBNotifyPointer\fR
\fBNotifyInferior\fR	\fBNotifyPointerRoot\fR
\fBNotifyNonlinear\fR	\fBNotifyVirtual\fR
.DE
For \fBConfigureRequest\fR events, the string will be one of:
.DS
.ta 6c
\fBAbove\fR	\fBOpposite\fR
\fBBelow\fR	\fBNone\fR
\fBBottomIf\fR	\fBTopIf\fR
.DE
For virtual events, the string will be whatever value is stored in the
\fIuser_data\fR field when the event was created (typically with
\fBevent generate\fR), or the empty string if the field is NULL.
Virtual events corresponding to key sequence presses (see \fBevent
add\fR for details) set the \fIuser_data\fR to NULL.
For events other than these, the substituted string is undefined.
.RE
.IP \fB%f\fR 5
The \fIfocus\fR field from the event (\fB0\fR or \fB1\fR).  Valid only
for \fBEnter\fR and \fBLeave\fR events.  \fB1\fR if the receiving
window is the focus window or a descendant of the focus window,
\fB0\fR otherwise.
.IP \fB%h\fR 5
The \fIheight\fR field from the event.  Valid for the \fBConfigure\fR,
\fBConfigureRequest\fR, \fBCreate\fR, \fBResizeRequest\fR, and
\fBExpose\fR events.
Indicates the new or requested height of the window.
.IP \fB%i\fR 5
The \fIwindow\fR field from the event, represented as a hexadecimal
integer.  Valid for all event types.
.IP \fB%k\fR 5
The \fIkeycode\fR field from the event.  Valid only for \fBKeyPress\fR
and \fBKeyRelease\fR events.
.IP \fB%m\fR 5
The \fImode\fR field from the event.  The substituted string is one of
\fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or
\fBNotifyWhileGrabbed\fR.  Valid only for \fBEnter\fR,
\fBFocusIn\fR, \fBFocusOut\fR, and \fBLeave\fR events.
.IP \fB%o\fR 5
The \fIoverride_redirect\fR field from the event.  Valid only for
\fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events.
.IP \fB%p\fR 5
The \fIplace\fR field from the event, substituted as one of the
strings \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR.  Valid only
for \fBCirculate\fR and \fBCirculateRequest\fR events.
.IP \fB%s\fR 5
The \fIstate\fR field from the event.  For \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
\fBLeave\fR, and \fBMotion\fR events, a decimal string
is substituted.  For \fBVisibility\fR, one of the strings
\fBVisibilityUnobscured\fR, \fBVisibilityPartiallyObscured\fR,
and \fBVisibilityFullyObscured\fR is substituted.
For \fBProperty\fR events, substituted with
either the string \fBNewValue\fR (indicating that the property
has been created or modified) or \fBDelete\fR (indicating that
the property has been removed).
.IP \fB%t\fR 5
The \fItime\fR field from the event.
This is the X server timestamp (typically the time since
the last server reset) in milliseconds, when the event occurred.
Valid for most events.
.IP \fB%w\fR 5
The \fIwidth\fR field from the event.
Indicates the new or requested width of the window.
Valid only for
\fBConfigure\fR, \fBConfigureRequest\fR, \fBCreate\fR,
\fBResizeRequest\fR, and \fBExpose\fR events.
.IP "\fB%x\fR, \fB%y\fR" 5
The \fIx\fR and \fIy\fR fields from the event.
For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
relative to the receiving window.
For \fBEnter\fR and \fBLeave\fR events, the position where the
mouse pointer crossed the window, relative to the receiving window.
For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
coordinates of the window relative to its parent window.
.IP \fB%A\fR 5
Substitutes the UNICODE character corresponding to the event, or
the empty string if the event does not correspond to a UNICODE character
(e.g. the shift key was pressed). \fBXmbLookupString\fR (or
\fBXLookupString\fR when input method support is turned off) does all
the work of translating from the event to a UNICODE character.
Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%B\fR 5
The \fIborder_width\fR field from the event.  Valid only for
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
.IP \fB%D\fR 5
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event.  The
\fIdelta\fR value represents the rotation units the mouse wheel has
been moved.  On Windows 95 & 98 systems the smallest value for the
delta is 120.  Future systems may support higher resolution values for
the delta.  The sign of the value represents the direction the mouse
wheel was scrolled.
.IP \fB%E\fR 5
The \fIsend_event\fR field from the event.  Valid for all event types.
\fB0\fR indicates that this is a
.QW normal
event, \fB1\fR indicates that it is a
.QW synthetic
event generated by \fBSendEvent\fR.
.IP \fB%K\fR 5
The keysym corresponding to the event, substituted as a textual
string.  Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%N\fR 5
The keysym corresponding to the event, substituted as a decimal
number.  Valid only for \fBKeyPress\fR and \fBKeyRelease\fR events.
.IP \fB%P\fR 5
The name of the property being updated or deleted (which
may be converted to an XAtom using \fBwinfo atom\fR.) Valid
only for \fBProperty\fR events.
.IP \fB%R\fR 5
The \fIroot\fR window identifier from the event.  Valid only for
events containing a \fIroot\fR field.
.IP \fB%S\fR 5
The \fIsubwindow\fR window identifier from the event,
formatted as a hexadecimal number.
Valid only for events containing a \fIsubwindow\fR field.
.IP \fB%T\fR 5
The \fItype\fR field from the event.  Valid for all event types.
.IP \fB%W\fR 5
The path name of the window to which the event was reported (the
\fIwindow\fR field from the event).  Valid for all event types.
.IP "\fB%X\fR, \fB%Y\fR" 5
The \fIx_root\fR and  \fIy_root\fR fields from the event.
If a virtual-root window manager is being used then the substituted
values are the corresponding x-coordinate and y-coordinate in the virtual root.
Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
and \fBMotion\fR events.
Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
window.
.LP
The replacement string for a %-replacement is formatted as a proper
Tcl list element.
This means that spaces or special characters such as \fB$\fR and
\fB{\fR may be preceded by backslashes.
This guarantees that the string will be passed through the Tcl
parser when the binding script is evaluated.
Most replacements are numbers or well-defined strings such
as \fBAbove\fR;  for these replacements no special formatting
is ever necessary.
The most common case where reformatting occurs is for the \fB%A\fR
substitution.  For example, if \fIscript\fR is
.CS
\fBinsert\0%A\fR
.CE
and the character typed is an open square bracket, then the script
actually executed will be
.CS
\fBinsert\0\e[\fR
.CE
This will cause the \fBinsert\fR to receive the original replacement
string (open square bracket) as its first argument.
If the extra backslash had not been added, Tcl would not have been
able to parse the script correctly.
.SH "MULTIPLE MATCHES"
.PP
It is possible for several bindings to match a given X event.
If the bindings are associated with different \fItag\fR's,
then each of the bindings will be executed, in order.
By default, a binding for the widget will be executed first, followed
by a class binding, a binding for its toplevel, and
an \fBall\fR binding.
The \fBbindtags\fR command may be used to change this order for
a particular window or to associate additional binding tags with
the window.
.PP
The \fBcontinue\fR and \fBbreak\fR commands may be used inside a
binding script to control the processing of matching scripts.
If \fBcontinue\fR is invoked, then the current binding script
is terminated but Tk will continue processing binding scripts
associated with other \fItag\fR's.
If the \fBbreak\fR command is invoked within a binding script,
then that script terminates and no other scripts will be invoked
for the event.
.PP
If more than one binding matches a particular event and they
have the same \fItag\fR, then the most specific binding
is chosen and its script is evaluated.
The following tests are applied, in order, to determine which of
several matching sequences is more specific:
.RS
.IP (a)
an event pattern that specifies a specific button or key is more specific
than one that does not;
.IP (b)
a longer sequence (in terms of number
of events matched) is more specific than a shorter sequence;
.IP (c)
if the modifiers specified in one pattern are a subset of the
modifiers in another pattern, then the pattern with more modifiers
is more specific.
.IP (d)
a virtual event whose physical pattern matches the sequence is less
specific than the same physical pattern that is not associated with a
virtual event.
.IP (e)
given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined.
.RE
.PP
If the matching sequences contain more than one event, then tests
(c)\-(e) are applied in order from the most recent event to the least recent
event in the sequences.  If these tests fail to determine a winner, then the
most recently registered sequence is the winner.
.PP
If there are two (or more) virtual events that are both triggered by the
same sequence, and both of those virtual events are bound to the same window
tag, then only one of the virtual events will be triggered, and it will
be picked at random:
.CS
event add <<Paste>> <Control\-y>
event add <<Paste>> <Button\-2>
event add <<Scroll>> <Button\-2>
\fBbind\fR Entry <<Paste>> {puts Paste}
\fBbind\fR Entry <<Scroll>> {puts Scroll}
.CE
If the user types Control\-y, the \fB<<Paste>>\fR binding
will be invoked, but if the user presses button 2 then one of
either the \fB<<Paste>>\fR or the \fB<<Scroll>>\fR bindings will
be invoked, but exactly which one gets invoked is undefined.
.PP
If an X event does not match any of the existing bindings, then the
event is ignored.
An unbound event is not considered to be an error.
.SH "MULTI-EVENT SEQUENCES AND IGNORED EVENTS"
.PP
When a \fIsequence\fR specified in a \fBbind\fR command contains
more than one event pattern, then its script is executed whenever
the recent events (leading up to and including the current event)
match the given sequence.  This means, for example, that if button 1 is
clicked repeatedly the sequence \fB<Double\-ButtonPress\-1>\fR will match
each button press but the first.
If extraneous events that would prevent a match occur in the middle
of an event sequence then the extraneous events are
ignored unless they are \fBKeyPress\fR or \fBButtonPress\fR events.
For example, \fB<Double\-ButtonPress\-1>\fR will match a sequence of
presses of button 1, even though there will be \fBButtonRelease\fR
events (and possibly \fBMotion\fR events) between the
\fBButtonPress\fR events.
Furthermore, a \fBKeyPress\fR event may be preceded by any number
of other \fBKeyPress\fR events for modifier keys without the
modifier keys preventing a match.
For example, the event sequence \fBaB\fR will match a press of the
\fBa\fR key, a release of the \fBa\fR key, a press of the \fBShift\fR
key, and a press of the \fBb\fR key:  the press of \fBShift\fR is
ignored because it is a modifier key.
Finally, if several \fBMotion\fR events occur in a row, only
the last one is used for purposes of matching binding sequences.
.SH "ERRORS"
.PP
If an error occurs in executing the script for a binding then the
\fBbgerror\fR mechanism is used to report the error.
The \fBbgerror\fR command will be executed at global level
(outside the context of any Tcl procedure).
.SH "EXAMPLES"
.PP
Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked:
.CS
\fBbind\fR . <Double\-1> {
    puts "hi from (%x,%y)"
}
.CE
.PP
A little GUI that displays what the keysym name of the last key
pressed is:
.CS
set keysym "Press any key"
pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
\fBbind\fR . <Key> {
    set keysym "You pressed %K"
}
.CE
.SH "SEE ALSO"
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
.SH KEYWORDS
binding, event
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.31
log
@Fix [Bug 2118116]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.30 2008/06/30 22:57:02 dkf Exp $
d577 1
a577 2
This means that it will be surrounded with braces
if it contains spaces, or special characters such as \fB$\fR and
@


1.30
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.29 2007/12/13 15:23:43 dgp Exp $
d722 3
@


1.29
log
@merge stable branch onto HEAD
@
text
@d1 1
d10 1
a10 1
'\" RCS: @@(#) $Id: bind.n,v 1.20.2.3 2007/11/02 14:51:39 dgp Exp $
a156 1
.VS 8.5
a164 1
.VE 8.5
d433 1
a433 4
The \fIdetail\fR
.VS 8.5
or \fIuser_data\fR
.VE 8.5
a452 1
.VS 8.5
a457 1
.VE 8.5
d701 1
@


1.29.2.1
log
@Fix incorrect statement about %-substituees quoting.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.29 2007/12/13 15:23:43 dgp Exp $
d584 2
a585 1
This means that spaces or special characters such as \fB$\fR and
@


1.28
log
@Fix .DS/.DE to work better when transformed to a table
@
text
@d8 3
a10 3
'\"
'\" RCS: @@(#) $Id: bind.n,v 1.27 2007/11/01 11:33:37 das Exp $
'\"
@


1.27
log
@	* doc/bind.n:		document the Option modifier, clarify meaning
				and availability of Command & Option.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.26 2007/11/01 10:35:12 dkf Exp $
d108 10
a117 10
\fBControl\fR	\fBMod1, M1, Command\fR	    
\fBAlt\fR	\fBMod2, M2, Option\fR
\fBShift\fR	\fBMod3, M3\fR
\fBLock\fR	\fBMod4, M4\fR
\fBExtended\fR	\fBMod5, M5\fR
\fBButton1, B1\fR	\fBMeta, M\fR
\fBButton2, B2\fR	\fBDouble\fR
\fBButton3, B3\fR	\fBTriple\fR
\fBButton4, B4\fR	\fBQuadruple\fR
\fBButton5, B5\fR
d174 11
a184 11
.ta \w'ButtonPress, Button\0\0\0'u +\w'KeyPress, Key\0\0\0'u
\fBActivate	Destroy	Map
ButtonPress, Button	Enter	MapRequest
ButtonRelease	Expose	Motion
Circulate	FocusIn	MouseWheel
CirculateRequest	FocusOut	Property
Colormap	Gravity	Reparent
Configure	KeyPress, Key	ResizeRequest
ConfigureRequest	KeyRelease	Unmap
Create	Leave	Visibility
Deactivate\fR
d445 4
a448 4
\fBNotifyAncestor	NotifyNonlinearVirtual
NotifyDetailNone	NotifyPointer
NotifyInferior	NotifyPointerRoot
NotifyNonlinear	NotifyVirtual\fR
d453 3
a455 3
\fBAbove	Opposite
Below	None
BottomIf	TopIf\fR
@


1.26
log
@Documented the Command modifier. [Bug 1232908]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.25 2007/10/29 16:04:13 dkf Exp $
d108 2
a109 1
\fBControl\fR	\fBMod2, M2\fR
d112 6
a117 7
\fBButton1, B1\fR	\fBMod5, M5\fR
\fBButton2, B2\fR	\fBMeta, M\fR
\fBButton3, B3\fR	\fBAlt\fR
\fBButton4, B4\fR	\fBDouble\fR
\fBButton5, B5\fR	\fBTriple\fR
\fBMod1, M1\fR	\fBQuadruple\fR
\fBCommand\fR	\fBExtended\fR
d153 2
a154 2
The \fBCommand\fR modifier is much like the \fBControl\fR and
\fBAlt\fR modifiers, but is only supported on Macintoshes.
@


1.25
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.24 2007/10/26 20:13:23 dgp Exp $
a19 1

d78 1
a78 1
\fB<\fImodifier-modifier-type-detail\fB>\fR
d117 1
a117 1
\fBExtended\fR
d129 2
a130 2
are down, the pattern \fB<Control-Button-1>\fR will match
the event, but \fB<Mod1-Button-1>\fR will not.
d149 2
a150 2
substantial mouse motion in between.  For example, \fB<Double-Button-1>\fR
is equivalent to \fB<Button-1><Button-1>\fR with the extra time and space
d153 3
d360 1
a360 1
number of a button (1-5).  If a button number is given, then only an
d369 1
a369 1
is equivalent to \fB<ButtonPress-1>\fR.
d392 2
a393 2
For example, \fB<Control-comma>\fR is equivalent to
\fB<Control-KeyPress-comma>\fR.
d662 3
a664 3
event add <<Paste>> <Control-y>
event add <<Paste>> <Button-2>
event add <<Scroll>> <Button-2>
d668 1
a668 1
If the user types Control-y, the \fB<<Paste>>\fR binding
d682 1
a682 1
clicked repeatedly the sequence \fB<Double-ButtonPress-1>\fR will match
d687 1
a687 1
For example, \fB<Double-ButtonPress-1>\fR will match a sequence of
d710 1
a710 1
\fBbind\fR . <Double-1> {
@


1.24
log
@        * doc/*.1:              Revert doc changes that broke
        * doc/*.3:              `make html` so we can get the release
        * doc/*.n:              out the door.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.21 2007/10/16 15:11:36 dkf Exp $
d28 3
a30 1
If \fIscript\fR is prefixed with a ``+'', then it is appended to
d156 3
a158 2
appears on events that are associated with the keys on the "extended
keyboard."  On a US keyboard, the extended keys include the \fBAlt\fR
d274 3
a276 2
to a widget, it is in a ``half-dead'' state: the widget still exists,
but most operations on it will fail.
d287 2
a288 2
``virtual crossing'' focus events are sent to the intermediate
windows in the hierarchy.
d308 2
a309 1
``virtual crossing'' events are sent to intermediate windows
d324 1
a324 1
specifying a \fB-colormap\fR option; the window manager
d372 11
a382 6
they include all the alphanumeric ASCII characters (e.g. ``a'' is
the keysym for the ASCII character ``a''), plus descriptions for
non-alphanumeric characters (``comma'' is the keysym for the comma
character), plus descriptions for all the non-ASCII keys on the
keyboard (``Shift_L'' is the keysym for the left shift key, and
``F1'' is the keysym for the F1 function key, if it exists).  The
d526 1
a526 1
the empty string if the event doesn't correspond to a UNICODE character
d543 5
a547 2
\fB0\fR indicates that this is a ``normal'' event, \fB1\fR indicates
that it is a ``synthetic'' event generated by \fBSendEvent\fR.
d602 1
a602 1
If the extra backslash hadn't been added, Tcl would not have been
d630 6
a635 3
(a) an event pattern that specifies a specific button or key is more specific
than one that doesn't;
(b) a longer sequence (in terms of number
d637 2
a638 1
(c) if the modifiers specified in one pattern are a subset of the
d641 2
a642 1
(d) a virtual event whose physical pattern matches the sequence is less
d645 2
a646 1
(e) given a sequence that matches two or more virtual events, one
d648 1
d651 1
a651 1
(c)-(e) are applied in order from the most recent event to the least recent
d717 1
a717 1
pack [label .l -textvariable keysym -padx 2m -pady 1m]
a721 1

a723 1

@


1.23
log
@Fix minor faults
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.22 2007/10/24 14:32:57 dkf Exp $
d28 1
a28 3
If \fIscript\fR is prefixed with a
.QW + ,
then it is appended to
d169 1
a169 1
.ta 2.5i +2i
d270 3
a272 3
When the \fBDestroy\fR event is delivered to a widget, it is in a
.QW half-dead
state: the widget still exists, but most operations on it will fail.
d283 2
a284 2
.QW "virtual crossing"
focus events are sent to the intermediate windows in the hierarchy.
d304 1
a304 2
.QW "virtual crossing"
events are sent to intermediate windows
d367 3
a369 7
they include all the alphanumeric ASCII characters (e.g.
.QW a
is the keysym for the ASCII character
.QW a ),
plus descriptions for non-alphanumeric characters (e.g.
.QW comma
is the keysym for the comma
d371 2
a372 5
keyboard (e.g.
.QW Shift_L
is the keysym for the left shift key, and
.QW F1
is the keysym for the F1 function key, if it exists).  The
d533 2
a534 5
\fB0\fR indicates that this is a
.QW normal
event, \fB1\fR indicates that it is a
.QW synthetic
event generated by \fBSendEvent\fR.
d702 1
d705 1
@


1.22
log
@Lots of improvements to look and feel of manual pages
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.21 2007/10/16 15:11:36 dkf Exp $
d171 1
a171 1
.ta \w'ButtonPress, Button\0\0\0'u +\w'KeyPress, Key\0\0\0'u
a714 1

a716 1

@


1.21
log
@Minor improvements
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.20 2006/11/15 13:29:17 dkf Exp $
d28 3
a30 1
If \fIscript\fR is prefixed with a ``+'', then it is appended to
d272 3
a274 3
When the \fBDestroy\fR event is delivered
to a widget, it is in a ``half-dead'' state: the widget still exists,
but most operations on it will fail.
d285 2
a286 2
``virtual crossing'' focus events are sent to the intermediate
windows in the hierarchy.
d306 2
a307 1
``virtual crossing'' events are sent to intermediate windows
d370 7
a376 3
they include all the alphanumeric ASCII characters (e.g. ``a'' is
the keysym for the ASCII character ``a''), plus descriptions for
non-alphanumeric characters (``comma'' is the keysym for the comma
d378 5
a382 2
keyboard (``Shift_L'' is the keysym for the left shift key, and
``F1'' is the keysym for the F1 function key, if it exists).  The
d543 5
a547 2
\fB0\fR indicates that this is a ``normal'' event, \fB1\fR indicates
that it is a ``synthetic'' event generated by \fBSendEvent\fR.
@


1.20
log
@Convert \fP to \fR so that man-page scrapers have an easier time.
@
text
@d8 3
a10 3
'\" 
'\" RCS: @@(#) $Id: bind.n,v 1.19 2005/04/06 21:11:54 dkf Exp $
'\" 
d97 1
a97 1
respond immediately to the new definition.  
d108 1
a108 1
\fBShift\fR	\fBMod3, M3\fR	
d110 1
a110 1
\fBButton1, B1\fR	\fBMod5, M5\fR	
d173 1
a173 1
Circulate	FocusIn	MouseWheel	
d220 1
a220 1
\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are 
d226 1
a226 1
Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR 
d248 1
a248 1
Note that geometry managers typically do not map their children until 
d263 1
a263 1
It is normally not necessary for client applications to 
d266 1
a266 1
A \fBDestroy\fR event is delivered to a window when 
d287 1
a287 1
and a \fBFocusOut\fR event indicates that the focus 
d291 1
a291 1
or implicitly by the window manager.  
d296 1
a296 1
the pointer leaves it.  
d456 2
a457 2
for \fBEnter\fR and \fBLeave\fR events.  \fB1\fR if the receiving 
window is the focus window or a descendant of the focus window, 
d497 1
a497 1
Valid for most events.  
d506 1
a506 1
For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR, 
d510 1
a510 1
For \fBEnter\fR and \fBLeave\fR events, the position where the 
d557 2
a558 2
.IP \fB%X\fR 5
The \fIx_root\fR field from the event.
d560 1
a560 1
value is the corresponding x-coordinate in the virtual root.
d564 2
a565 9
Same meaning as \fB%x\fR, except relative to the (virtual) root window.
.IP \fB%Y\fR 5
The \fIy_root\fR field from the event.
If a virtual-root window manager is being used then the substituted
value is the corresponding y-coordinate in the virtual root.
Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
and \fBMotion\fR events.
Same meaning as \fB%y\fR, except relative to the (virtual) root window.
d625 1
a625 1
specific than the same physical pattern that is not associated with a 
d627 1
a627 1
(e) given a sequence that matches two or more virtual events, one 
d638 1
a638 1
be picked at random:  
@


1.20.2.1
log
@merge updates from HEAD
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.20 2006/11/15 13:29:17 dkf Exp $
d97 1
a97 1
respond immediately to the new definition.
d108 1
a108 1
\fBShift\fR	\fBMod3, M3\fR
d110 1
a110 1
\fBButton1, B1\fR	\fBMod5, M5\fR
d173 1
a173 1
Circulate	FocusIn	MouseWheel
d220 1
a220 1
\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are
d226 1
a226 1
Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR
d248 1
a248 1
Note that geometry managers typically do not map their children until
d263 1
a263 1
It is normally not necessary for client applications to
d266 1
a266 1
A \fBDestroy\fR event is delivered to a window when
d287 1
a287 1
and a \fBFocusOut\fR event indicates that the focus
d291 1
a291 1
or implicitly by the window manager.
d296 1
a296 1
the pointer leaves it.
d456 2
a457 2
for \fBEnter\fR and \fBLeave\fR events.  \fB1\fR if the receiving
window is the focus window or a descendant of the focus window,
d497 1
a497 1
Valid for most events.
d506 1
a506 1
For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
d510 1
a510 1
For \fBEnter\fR and \fBLeave\fR events, the position where the
d557 2
a558 2
.IP "\fB%X\fR, \fB%Y\fR" 5
The \fIx_root\fR and  \fIy_root\fR fields from the event.
d560 1
a560 1
values are the corresponding x-coordinate and y-coordinate in the virtual root.
d564 9
a572 2
Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
window.
d632 1
a632 1
specific than the same physical pattern that is not associated with a
d634 1
a634 1
(e) given a sequence that matches two or more virtual events, one
d645 1
a645 1
be picked at random:
@


1.20.2.2
log
@merge updates from HEAD
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.20.2.1 2007/10/17 14:37:05 dgp Exp $
d20 1
d28 1
a28 3
If \fIscript\fR is prefixed with a
.QW + ,
then it is appended to
d77 1
a77 1
\fB<\fImodifier\-modifier\-type\-detail\fB>\fR
d107 1
a107 2
\fBControl\fR	\fBMod1, M1, Command\fR	    
\fBAlt\fR	\fBMod2, M2, Option\fR
d110 7
a116 6
\fBExtended\fR	\fBMod5, M5\fR
\fBButton1, B1\fR	\fBMeta, M\fR
\fBButton2, B2\fR	\fBDouble\fR
\fBButton3, B3\fR	\fBTriple\fR
\fBButton4, B4\fR	\fBQuadruple\fR
\fBButton5, B5\fR
d128 2
a129 2
are down, the pattern \fB<Control\-Button\-1>\fR will match
the event, but \fB<Mod1\-Button\-1>\fR will not.
d148 2
a149 2
substantial mouse motion in between.  For example, \fB<Double\-Button\-1>\fR
is equivalent to \fB<Button\-1><Button\-1>\fR with the extra time and space
a151 3
The \fBCommand\fR and \fBOption\fR modifiers are equivalents of \fBMod1\fR
resp. \fBMod2\fR, they correspond to Macintosh-specific modifier keys.
.PP
d154 2
a155 3
appears on events that are associated with the keys on the
.QW "extended keyboard" .
On a US keyboard, the extended keys include the \fBAlt\fR
d271 2
a272 3
to a widget, it is in a
.QW half-dead
state: the widget still exists, but most operations on it will fail.
d283 2
a284 2
.QW "virtual crossing"
focus events are sent to the intermediate windows in the hierarchy.
d304 1
a304 2
.QW "virtual crossing"
events are sent to intermediate windows
d319 1
a319 1
specifying a \fB\-colormap\fR option; the window manager
d353 1
a353 1
number of a button (1\-5).  If a button number is given, then only an
d362 1
a362 1
is equivalent to \fB<ButtonPress\-1>\fR.
d367 6
a372 11
they include all the alphanumeric ASCII characters (e.g.
.QW a
is the keysym for the ASCII character
.QW a ),
plus descriptions for non-alphanumeric characters
.PQ comma "is the keysym for the comma character" ,
plus descriptions for all the non-ASCII keys on the keyboard (e.g.
.QW Shift_L
is the keysym for the left shift key, and
.QW F1
is the keysym for the F1 function key, if it exists).  The
d380 2
a381 2
For example, \fB<Control\-comma>\fR is equivalent to
\fB<Control\-KeyPress\-comma>\fR.
d516 1
a516 1
the empty string if the event does not correspond to a UNICODE character
d533 2
a534 5
\fB0\fR indicates that this is a
.QW normal
event, \fB1\fR indicates that it is a
.QW synthetic
event generated by \fBSendEvent\fR.
d589 1
a589 1
If the extra backslash had not been added, Tcl would not have been
d617 3
a619 6
.RS
.IP (a)
an event pattern that specifies a specific button or key is more specific
than one that does not;
.IP (b)
a longer sequence (in terms of number
d621 1
a621 2
.IP (c)
if the modifiers specified in one pattern are a subset of the
d624 1
a624 2
.IP (d)
a virtual event whose physical pattern matches the sequence is less
d627 1
a627 2
.IP (e)
given a sequence that matches two or more virtual events, one
a628 1
.RE
d631 1
a631 1
(c)\-(e) are applied in order from the most recent event to the least recent
d640 3
a642 3
event add <<Paste>> <Control\-y>
event add <<Paste>> <Button\-2>
event add <<Scroll>> <Button\-2>
d646 1
a646 1
If the user types Control\-y, the \fB<<Paste>>\fR binding
d660 1
a660 1
clicked repeatedly the sequence \fB<Double\-ButtonPress\-1>\fR will match
d665 1
a665 1
For example, \fB<Double\-ButtonPress\-1>\fR will match a sequence of
d688 1
a688 1
\fBbind\fR . <Double\-1> {
d697 1
a697 1
pack [label .l \-textvariable keysym \-padx 2m \-pady 1m]
d702 1
d705 1
@


1.20.2.3
log
@merge updates from HEAD
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.20.2.2 2007/11/01 16:37:13 dgp Exp $
d108 10
a117 10
\fBControl\fR	\fBMod1\fR, \fBM1\fR, \fBCommand\fR
\fBAlt\fR	\fBMod2\fR, \fBM2\fR, \fBOption\fR
\fBShift\fR	\fBMod3\fR, \fBM3\fR
\fBLock\fR	\fBMod4\fR, \fBM4\fR
\fBExtended\fR	\fBMod5\fR, \fBM5\fR
\fBButton1\fR, \fBB1\fR	\fBMeta\fR, \fBM\fR
\fBButton2\fR, \fBB2\fR	\fBDouble\fR
\fBButton3\fR, \fBB3\fR	\fBTriple\fR
\fBButton4\fR, \fBB4\fR	\fBQuadruple\fR
\fBButton5\fR, \fBB5\fR
d174 11
a184 11
.ta \w'\fBButtonPress, Button\0\0\0\fR'u +\w'\fBKeyPress, Key\0\0\0\fR'u
\fBActivate\fR	\fBDestroy\fR	\fBMap\fR
\fBButtonPress\fR, \fBButton\fR	\fBEnter\fR	\fBMapRequest\fR
\fBButtonRelease\fR	\fBExpose\fR	\fBMotion\fR
\fBCirculate\fR	\fBFocusIn\fR	\fBMouseWheel\fR
\fBCirculateRequest\fR	\fBFocusOut\fR	\fBProperty\fR
\fBColormap\fR	\fBGravity\fR	\fBReparent\fR
\fBConfigure\fR	\fBKeyPress\fR, \fBKey\fR	\fBResizeRequest\fR
\fBConfigureRequest\fR	\fBKeyRelease\fR	\fBUnmap\fR
\fBCreate\fR	\fBLeave\fR	\fBVisibility\fR
\fBDeactivate\fR
d445 4
a448 4
\fBNotifyAncestor\fR	\fBNotifyNonlinearVirtual\fR
\fBNotifyDetailNone\fR	\fBNotifyPointer\fR
\fBNotifyInferior\fR	\fBNotifyPointerRoot\fR
\fBNotifyNonlinear\fR	\fBNotifyVirtual\fR
d453 3
a455 3
\fBAbove\fR	\fBOpposite\fR
\fBBelow\fR	\fBNone\fR
\fBBottomIf\fR	\fBTopIf\fR
@


1.19
log
@Purge old and inaccurate .VS/.VE macros.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.18 2004/10/28 10:22:51 dkf Exp $
d212 3
a214 3
.IP "\fBKeyPress\fP, \fBKeyRelease\fP" 5
The \fBKeyPress\fP and \fBKeyRelease\fP events are generated
whenever a key is pressed or released.  \fBKeyPress\fP and \fBKeyRelease\fP
d216 2
a217 2
.IP "\fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP" 5
The \fBButtonPress\fP and \fBButtonRelease\fP events
d219 2
a220 2
\fBMotion\fP events are generated whenever the pointer is moved.
\fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP events are 
d226 1
a226 1
Subsequent \fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP 
d231 2
a232 2
.IP \fBConfigure\fP 5
A \fBConfigure\fP event is sent to a window whenever its
d235 2
a236 2
.IP "\fBMap\fP, \fBUnmap\fP" 5
The \fBMap\fP and \fBUnmap\fP events are generated whenever the mapping
d242 2
a243 2
\fBnormal\fP state, and are unmapped in the \fBwithdrawn\fP
and \fBiconic\fP states.
d245 1
a245 1
of a geometry manager (for example \fBpack\fP or \fBgrid\fP).
d247 1
a247 1
A window is \fIviewable\fP only if it and all of its ancestors are mapped.
d250 1
a250 1
when they become unmapped; hence in Tk \fBMap\fP and \fBUnmap\fP
d253 2
a254 2
.IP \fBVisibility\fP 5
A window is said to be \fIobscured\fP when another window
d256 2
a257 2
\fBVisibility\fP events are generated whenever a window's
obscurity state changes; the \fIstate\fP field (\fB%s\fP)
d259 2
a260 2
.IP \fBExpose\fP 5
An \fBExpose\fP event is generated whenever all or part of a
d264 3
a266 3
handle \fBExpose\fP events, since Tk handles them internally.
.IP \fBDestroy\fP 5
A \fBDestroy\fP event is delivered to a window when 
d270 1
a270 1
When the \fBDestroy\fP event is delivered
d274 2
a275 2
.IP "\fBFocusIn\fP, \fBFocusOut\fP" 5
The \fBFocusIn\fP and \fBFocusOut\fP events are generated
d277 2
a278 2
A \fBFocusOut\fP event is sent to the old focus window,
and a \fBFocusIn\fP event is sent to the new one.
d285 1
a285 1
Thus a \fBFocusIn\fP event indicates
d287 1
a287 1
and a \fBFocusOut\fP event indicates that the focus 
d290 1
a290 1
The keyboard focus may be changed explicitly by a call to \fBfocus\fP,
d293 3
a295 3
.IP "\fBEnter\fP, \fBLeave\fP" 5
An \fBEnter\fP event is sent to a window when the pointer
enters that window, and a \fBLeave\fP event is sent when
d299 1
a299 1
If there is a pointer grab in effect, \fBEnter\fP and \fBLeave\fP
d303 1
a303 1
between two windows, \fBEnter\fP and \fBLeave\fP
d305 2
a306 2
in the hierarchy in the same manner as for \fBFocusIn\fP and
\fBFocusOut\fP events.
d308 2
a309 2
.IP \fBProperty\fP
A \fBProperty\fP event is sent to a window whenever an X property
d311 1
a311 1
\fBProperty\fP events are not normally delivered to Tk applications as
d313 2
a314 2
.IP \fBColormap\fP
A \fBColormap\fP event is generated whenever the colormap
d319 1
a319 1
specifying a \fB-colormap\fP option; the window manager
d326 1
a326 1
.IP "\fBMapRequest\fP, \fBCirculateRequest\fP, \fBResizeRequest\fP, \fBConfigureRequest\fP, \fBCreate\fP" 5
d331 1
a331 1
selected \fBSubstructureRedirectMask\fP on a window;
d333 2
a334 2
.IP "\fBGravity\fP, \fBReparent\fP, \fBCirculate\fP" 5
The events \fBGravity\fP and \fBReparent\fP
d339 1
a339 1
A \fBCirculate\fP event indicates that the window has moved
d341 1
a341 1
a result of an \fBXCirculateSubwindows\fP protocol request.
d343 2
a344 2
which do not generate a \fBCirculate\fP event, and that
Tk does not use \fBXCirculateSubwindows()\fP internally.
d412 1
a412 1
in the stacking order, or \fB0\fP if the receiving window is at the
d419 1
a419 1
Indicates that there are \fIcount\fP pending \fBExpose\fP events which have not
d456 1
a456 1
for \fBEnter\fR and \fBLeave\fR events.  \fB1\fP if the receiving 
d458 1
a458 1
\fB0\fP otherwise.
d489 3
a491 3
For \fBProperty\fP events, substituted with
either the string \fBNewValue\fP (indicating that the property
has been created or modified) or \fBDelete\fP (indicating that
d506 3
a508 3
For \fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP, 
\fBKeyPress\fP, \fBKeyRelease\fP, and \fBMouseWheel\fP events,
\fB%x\fP and \fB%y\fP indicate the position of the mouse pointer
d510 1
a510 1
For \fBEnter\fP and \fBLeave\fP events, the position where the 
d512 1
a512 1
For \fBConfigure\fP and \fBCreate\fP requests, the \fIx\fP and \fIy\fP
d533 2
a534 2
\fB0\fP indicates that this is a ``normal'' event, \fB1\fP indicates
that it is a ``synthetic'' event generated by \fBSendEvent\fP.
d544 1
a544 1
only for \fBProperty\fP events.
d564 1
a564 1
Same meaning as \fB%x\fP, except relative to the (virtual) root window.
d572 1
a572 1
Same meaning as \fB%y\fP, except relative to the (virtual) root window.
@


1.18
log
@Assorted minor documentation fixes
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.17 2004/08/29 09:27:35 dkf Exp $
a68 1
.VS
a70 1
.VE
a115 1
.VS
a116 1
.VE
a459 1
.VS
a463 1
.VE
a472 1
.VS
a474 1
.VE
a501 1
.VS
a503 1
.VE
a524 1
.VS
a530 1
.VE
@


1.17
log
@TIP#165 (user data field) implementation.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.16 2004/08/20 10:56:36 dkf Exp $
d118 1
d120 1
d156 1
d164 1
d226 2
a227 1

d234 1
d242 2
a243 1

d250 1
a250 1

d256 1
d272 2
a273 1

d277 1
d283 2
a284 1

d293 1
a293 1

d296 1
d301 2
a302 1

d305 1
a305 1

d311 1
d320 2
a321 1

d326 1
a326 1

d328 1
d341 2
a342 1

d352 1
d449 1
a449 1
.VS
d455 1
a455 1
.VE
d662 2
a663 2
bind Entry <<Paste>> {puts Paste}
bind Entry <<Scroll>> {puts Scroll}
d711 1
a711 1

@


1.16
log
@Spelling and grammar fixes from Mikhail Kolesnitchenko. [Patch 1012083]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.15 2004/07/05 21:21:52 dkf Exp $
a87 1
.VS
d100 1
a100 1

a103 1
.VE
d408 5
a412 1
The \fIdetail\fR field from the event.  The \fB%d\fR is replaced by
d431 7
@


1.15
log
@TIP#158 implementation; keypad keys on Win are now distinguishable.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.14 2004/06/21 19:32:54 dkf Exp $
d138 1
a138 1
\fBM1\fR through \fBM5\fR modifiers is associated with the meta
d140 1
a140 1
If there are no meta keys, or if they are not associated with any
d201 1
a201 1
Some mice on the Windows platform support a mouse wheel which is used
d207 2
a208 2
\fIdelta\fR field for the event which is a integer value of motion
that the mouse wheel has moved.  The smallest value for which the
d330 1
a330 1
a result of a \fBXCirculateSubwindows\fP protocol request.
d359 1
a359 1
keyboard (``Shift_L'' is the keysm for the left shift key, and
d399 1
a399 1
Inidicates the sibling window immediately below the receiving window
d441 1
a441 1
Inidicates the new or requested height of the window.
d481 1
a481 1
Inidicates the new or requested width of the window.
d496 1
a496 1
cooredinates of the window relative to its parent window.
@


1.14
log
@Highlight the command whose examples these are
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.13 2004/06/21 19:31:51 dkf Exp $
d120 1
d155 8
@


1.13
log
@Compacted the synopsis
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.12 2004/05/23 20:51:51 dkf Exp $
d671 1
a671 1
bind . <Double-1> {
d681 1
a681 1
bind . <Key> {
@


1.12
log
@Minor fixes.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.11 2004/04/23 13:47:46 dkf Exp $
d18 1
a18 7
\fBbind\fI tag\fR
.sp
\fBbind\fI tag sequence\fR
.sp
\fBbind\fI tag sequence script\fR
.sp
\fBbind\fI tag sequence \fB+\fIscript\fR
@


1.11
log
@Added examples and did some doc L&F improvements.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.10 2004/01/09 22:26:24 pspjuth Exp $
a70 1

a111 1

a159 1

a333 1

a366 1

a579 1

a642 1

a666 1

a672 1

d693 1
a693 1
bgerror(n), keysyms(n), grab(n), focus(n), bindtags(n), event(n)
@


1.10
log
@Typo fix.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.9 2003/09/13 20:27:32 jenglish Exp $
d27 1
a27 1
.SH INTRODUCTION
d59 1
a59 1
.IP
d62 1
a62 1
.IP
d65 1
a65 1
.IP
d68 1
a68 1
.IP
d94 1
a95 1
.PP
d108 4
d113 2
a114 1
.SH "MODIFIERS"
d163 1
a163 1
.SH "EVENT TYPES"
d171 1
a171 1
.ta 5c 10c
a182 1
.PP
d189 1
a189 2
.IP \fBActivate\fR 5
.IP \fBDeactivate\fR 5
d214 2
a215 4

.IP \fBKeyPress\fP
.IP \fBKeyRelease\fP
\fBKeyPress\fP and \fBKeyRelease\fP events are generated
d218 2
a219 5

.IP \fBButtonPress\fP
.IP \fBButtonRelease\fP
.IP \fBMotion\fP
\fBButtonPress\fP and \fBButtonRelease\fP events
d224 1
a224 1
.br
d231 2
a232 4


.IP \fBConfigure\fP
\fBConfigure\fP events are sent to a window whenever its
d235 3
a238 5
.IP \fBMap\fP
.IP \fBUnmap\fP
\fBMap\fP and \fBUnmap\fP events are generated whenever the mapping
state of a window changes.
.br
d245 1
a245 1
.br
d251 1
a251 2

.IP \fBVisibility\fP
d257 2
a258 3

.IP \fBExpose\fP
\fBExpose\fP events are generated whenever all or part of a
d263 1
a263 2

.IP \fBDestroy\fP
d266 1
a266 1
.br
d270 2
a271 4

.IP \fBFocusIn\fP
.IP \fBFocusOut\fP
\fBFocusIn\fP and \fBFocusOut\fP events are generated
d275 1
a275 1
.br
d284 1
a284 1
.br
d287 1
a287 4

.IP \fBEnter\fP
.IP \fBLeave\fP
.br
d291 1
a291 1
.br
d294 1
a294 1
.br 
a299 1

d301 1
a301 1
\fBProperty\fP events are sent to a window whenever an X property
d303 2
a304 2
\fBProperty\fP events are not normally delivered to Tk applications.

d306 1
a306 1
\fBColormap\fP events are generated whenever the colormap
d308 1
a308 1
.br
d313 1
a313 1
.br
d315 2
a316 7

'\" Added in wm-enablers patch:
.IP \fBMapRequest\fP
.IP \fBCirculateRequest\fP
.IP \fBResizeRequest\fP
.IP \fBConfigureRequest\fP
.IP \fBCreate\fP
d323 2
a324 7

.IP \fBGravity\fP
.IP \fBReparent\fP
.IP \fBCirculate\fP
\fBGravity\fP,
and
\fBReparent\fP
d327 1
a327 1
.br
d338 1
a338 1
.SH "EVENT DETAILS"
d489 1
a489 2
.IP \fB%x\fR 5
.IP \fB%y\fR 5
d509 1
a510 1
.IP \fB%D\fR 5
d675 1
a675 1
.SH ERRORS
d682 19
d702 1
a702 1
bgerror, keysyms, grab, focus, bindtags, event
@


1.9
log
@Describe %P and %s substitution for Property events. [BUG #577906]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.8 2003/08/19 19:08:08 jenglish Exp $
d331 1
a331 1
.\" Added in wm-enablers patch:
@


1.8
log
@* doc/bind.n: Added more information on event types and details
[FRQ #523593 "bind(n) manpage needs more detail"]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.7 2002/09/30 09:35:39 dkf Exp $
a318 2
.br
Note that Tk provides no useful details for this event type.
d497 4
d554 4
@


1.7
log
@	* doc/bind.n: Doc-fix to mention that %A substitutes UNICODE
	characters rather than ASCII ones.  Tk's done this ever since 8.1
	in any case; after all, it is the right thing to do.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.6 2002/06/14 22:25:11 jenglish Exp $
a178 1
.VS
d211 155
a365 1
.VE
d428 3
d436 2
d462 3
a464 1
for \fBEnter\fR and \fBLeave\fR events.
d470 1
d474 1
a474 1
integer.
d500 4
a503 2
The \fItime\fR field from the event.  Valid only for events that
contain a \fItime\fR field.
d505 3
a507 1
The \fIwidth\fR field from the event.  Valid only for
a512 2
The \fIx\fR field from the event.  Valid only for events containing
an \fIx\fR field.
d514 9
a522 2
The \fIy\fR field from the event.  Valid only for events containing
a \fIy\fR field.
d544 2
d571 1
d579 1
d703 1
a703 1
bgerror, keysyms
d706 1
a706 1
form, manual
@


1.7.2.1
log
@Update the docs for the Mac OS X MouseWheel changes.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id$
d202 2
a203 3
application can use to scroll.  On Windows, the event is
always routed to the window that currently has focus. On Mac OS X,
the event is routed to the window under the pointer.  When the event
d209 3
a211 4
resolution devices may be available in the future.  On Mac OS X, the value is
not scaled by 120, but a value of 1 corresponds to roughly one text line.
The sign of the value determines which direction your widget should scroll.  
Positive values should scroll up and negative values should scroll down.
@


1.7.2.2
log
@Backport of documentation fixes
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.7.2.1 2004/02/16 23:20:02 wolfsuit Exp $
d18 7
a24 1
\fBbind\fI tag\fR ?\fIsequence\fR? ?\fB+\fR??\fIscript\fR?
d27 1
a27 1
.SH "INTRODUCTION"
d59 1
a59 1
.IP \(bu 3
d62 1
a62 1
.IP \(bu 3
d65 1
a65 1
.IP \(bu 3
d68 1
a68 1
.IP \(bu 3
d71 1
a107 4
.PP
Some widgets (e.g. \fBmenu\fR and \fBtext\fR) issue virtual events
when their internal state is updated in some ways.  Please see the
manual page for each widget for details.
d140 1
a140 1
\fBM1\fR through \fBM5\fR modifiers is associated with the Meta
d142 1
a142 1
If there are no Meta keys, or if they are not associated with any
d166 1
a166 1
.ta \w'ButtonPress, Button\0\0\0'u +\w'KeyPress, Key\0\0\0'u
d178 1
d186 2
a187 1
.IP "\fBActivate\fR, \fBDeactivate\fR" 5
d203 1
a203 2
always routed to the window that currently has focus (like \fBKey\fR
events.) On Mac OS X,
d206 2
a207 2
\fIdelta\fR field for the event, which is a integer value describing how
the mouse wheel has moved.  The smallest value for which the
a214 138
.IP "\fBKeyPress\fP, \fBKeyRelease\fP" 5
The \fBKeyPress\fP and \fBKeyRelease\fP events are generated
whenever a key is pressed or released.  \fBKeyPress\fP and \fBKeyRelease\fP
events are sent to the window which currently has the keyboard focus.
.IP "\fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP" 5
The \fBButtonPress\fP and \fBButtonRelease\fP events
are generated when the user presses or releases a mouse button.
\fBMotion\fP events are generated whenever the pointer is moved.
\fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP events are 
normally sent to the window containing the pointer.
.RS
.PP
When a mouse button is pressed, the window containing the pointer
automatically obtains a temporary pointer grab.
Subsequent \fBButtonPress\fP, \fBButtonRelease\fP, and \fBMotion\fP 
events will be sent to that window,
regardless of which window contains the pointer,
until all buttons have been released.
.RE
.IP \fBConfigure\fP 5
A \fBConfigure\fP event is sent to a window whenever its
size, position, or border width changes, and sometimes
when it has changed position in the stacking order.
.IP "\fBMap\fP, \fBUnmap\fP" 5
The \fBMap\fP and \fBUnmap\fP events are generated whenever the mapping
state of a window changes.
.RS
.PP
Windows are created in the unmapped state.
Top-level windows become mapped when they transition to the
\fBnormal\fP state, and are unmapped in the \fBwithdrawn\fP
and \fBiconic\fP states.
Other windows become mapped when they are placed under control
of a geometry manager (for example \fBpack\fP or \fBgrid\fP).
.PP
A window is \fIviewable\fP only if it and all of its ancestors are mapped.
Note that geometry managers typically do not map their children until 
they have been mapped themselves, and unmap all children
when they become unmapped; hence in Tk \fBMap\fP and \fBUnmap\fP
events indicate whether or not a window is viewable.
.RE
.IP \fBVisibility\fP 5
A window is said to be \fIobscured\fP when another window
above it in the stacking order fully or partially overlaps it.
\fBVisibility\fP events are generated whenever a window's
obscurity state changes; the \fIstate\fP field (\fB%s\fP)
specifies the new state.
.IP \fBExpose\fP 5
An \fBExpose\fP event is generated whenever all or part of a
window should be redrawn (for example, when a window is
first mapped or if it becomes unobscured).
It is normally not necessary for client applications to 
handle \fBExpose\fP events, since Tk handles them internally.
.IP \fBDestroy\fP 5
A \fBDestroy\fP event is delivered to a window when 
it is destroyed.
.RS
.PP
When the \fBDestroy\fP event is delivered
to a widget, it is in a ``half-dead'' state: the widget still exists,
but most operations on it will fail.
.RE
.IP "\fBFocusIn\fP, \fBFocusOut\fP" 5
The \fBFocusIn\fP and \fBFocusOut\fP events are generated
whenever the keyboard focus changes.
A \fBFocusOut\fP event is sent to the old focus window,
and a \fBFocusIn\fP event is sent to the new one.
.RS
.PP
In addition,
if the old and new focus windows do not share a common parent,
``virtual crossing'' focus events are sent to the intermediate
windows in the hierarchy.
Thus a \fBFocusIn\fP event indicates
that the target window or one of its descendants has acquired the focus,
and a \fBFocusOut\fP event indicates that the focus 
has been changed to a window outside the target window's hierarchy.
.PP
The keyboard focus may be changed explicitly by a call to \fBfocus\fP,
or implicitly by the window manager.  
.RE
.IP "\fBEnter\fP, \fBLeave\fP" 5
An \fBEnter\fP event is sent to a window when the pointer
enters that window, and a \fBLeave\fP event is sent when
the pointer leaves it.  
.RS
.PP
If there is a pointer grab in effect, \fBEnter\fP and \fBLeave\fP
events are only delivered to the window owning the grab.
.PP
In addition, when the pointer moves
between two windows, \fBEnter\fP and \fBLeave\fP
``virtual crossing'' events are sent to intermediate windows
in the hierarchy in the same manner as for \fBFocusIn\fP and
\fBFocusOut\fP events.
.RE
.IP \fBProperty\fP
A \fBProperty\fP event is sent to a window whenever an X property
belonging to that window is changed or deleted.
\fBProperty\fP events are not normally delivered to Tk applications as
they are handled by the Tk core.
.IP \fBColormap\fP
A \fBColormap\fP event is generated whenever the colormap
associated with a window has been changed, installed, or uninstalled.
.RS
.PP
Widgets may be assigned a private colormap by
specifying a \fB-colormap\fP option; the window manager
is responsible for installing and uninstalling colormaps
as necessary.
.PP
Note that Tk provides no useful details for this event type.
.RE
'\" The following events were added in TIP#47
.IP "\fBMapRequest\fP, \fBCirculateRequest\fP, \fBResizeRequest\fP, \fBConfigureRequest\fP, \fBCreate\fP" 5
These events are not normally delivered to Tk applications.
They are included for completeness, to make it possible to
write X11 window managers in Tk.
(These events are only delivered when a client has
selected \fBSubstructureRedirectMask\fP on a window;
the Tk core does not use this mask.)
.IP "\fBGravity\fP, \fBReparent\fP, \fBCirculate\fP" 5
The events \fBGravity\fP and \fBReparent\fP
are not normally delivered to Tk applications.
They are included for completeness.
.RS
.PP
A \fBCirculate\fP event indicates that the window has moved
to the top or to the bottom of the stacking order as
a result of an \fBXCirculateSubwindows\fP protocol request.
Note that the stacking order may be changed for other reasons
which do not generate a \fBCirculate\fP event, and that
Tk does not use \fBXCirculateSubwindows()\fP internally.
This event type is included only for completeness;
there is no reliable way to track changes to a window's
position in the stacking order.
.RE
.SH "EVENT DETAILS"
d236 1
a236 1
keyboard (``Shift_L'' is the keysym for the left shift key, and
d247 1
a276 3
Indicates the sibling window immediately below the receiving window
in the stacking order, or \fB0\fP if the receiving window is at the
bottom.
a281 2
Indicates that there are \fIcount\fP pending \fBExpose\fP events which have not
yet been delivered to the window.
d306 1
a306 3
for \fBEnter\fR and \fBLeave\fR events.  \fB1\fP if the receiving 
window is the focus window or a descendant of the focus window, 
\fB0\fP otherwise.
a311 1
Indicates the new or requested height of the window.
d315 1
a315 1
integer.  Valid for all event types.
a339 4
For \fBProperty\fP events, substituted with
either the string \fBNewValue\fP (indicating that the property
has been created or modified) or \fBDelete\fP (indicating that
the property has been removed).
d341 2
a342 4
The \fItime\fR field from the event.
This is the X server timestamp (typically the time since
the last server reset) in milliseconds, when the event occurred.
Valid for most events.  
d344 1
a344 3
The \fIwidth\fR field from the event.
Indicates the new or requested width of the window.
Valid only for
d349 6
a354 10
.IP "\fB%x\fR, \fB%y\fR" 5
The \fIx\fR and \fIy\fR fields from the event.
For \fBButtonPress\fP, \fBButtonRelease\fP, \fBMotion\fP, 
\fBKeyPress\fP, \fBKeyRelease\fP, and \fBMouseWheel\fP events,
\fB%x\fP and \fB%y\fP indicate the position of the mouse pointer
relative to the receiving window.
For \fBEnter\fP and \fBLeave\fP events, the position where the 
mouse pointer crossed the window, relative to the receiving window.
For \fBConfigure\fP and \fBCreate\fP requests, the \fIx\fP and \fIy\fP
coordinates of the window relative to its parent window.
d365 1
a366 1
.VS
a375 2
\fB0\fP indicates that this is a ``normal'' event, \fB1\fP indicates
that it is a ``synthetic'' event generated by \fBSendEvent\fP.
a381 4
.IP \fB%P\fR 5
The name of the property being updated or deleted (which
may be converted to an XAtom using \fBwinfo atom\fR.) Valid
only for \fBProperty\fP events.
a400 1
Same meaning as \fB%x\fP, except relative to the (virtual) root window.
a407 1
Same meaning as \fB%y\fP, except relative to the (virtual) root window.
d433 1
d486 2
a487 2
\fBbind\fR Entry <<Paste>> {puts Paste}
\fBbind\fR Entry <<Scroll>> {puts Scroll}
d497 1
d522 2
a523 1
.SH "ERRORS"
a528 18
.SH "EXAMPLES"
Arrange for a string describing the motion of the mouse to be printed
out when the mouse is double-clicked:
.CS
\fBbind\fR . <Double-1> {
    puts "hi from (%x,%y)"
}
.CE
.PP
A little GUI that displays what the keysym name of the last key
pressed is:
.CS
set keysym "Press any key"
pack [label .l -textvariable keysym -padx 2m -pady 1m]
\fBbind\fR . <Key> {
    set keysym "You pressed %K"
}
.CE
d531 1
a531 1
bgerror(n), bindtags(n), event(n), focus(n), grab(n), keysyms(n)
d534 1
a534 1
binding, event
@


1.6
log
@TIP #47 "Modifying Tk to Allow Writing X Window managers"
(patch from Neil McKay).
* Add CirculateRequest, Create, MapRequest, ResizeRequest,
  and ConfigureRequest event types;
* Split TK_TOPLEVEL flag into TK_TOPLEVEL, TK_HAS_WRAPPER,
  TK_WIN_MANAGED, and TK_TOP_HIERARCHY.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.2 1999/06/24 01:34:11 neil Exp $
d354 5
a358 4
Substitutes the ASCII character corresponding to the event, or
the empty string if the event doesn't correspond to an ASCII character
(e.g. the shift key was pressed).  \fBXLookupString\fR does all the
work of translating from the event to an ASCII character.
@


1.5
log
@	* doc/bind.n:
	* doc/canvas.n:
	* doc/entry.n:
	* doc/listbox.n:
	* doc/photo.n: doc fix-ups [Bug: 5396]
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.4 2000/04/27 18:28:54 ericm Exp $
d165 1
a165 1
.DS C
d167 5
a171 6
\fBActivate	Enter	Map
ButtonPress, Button	Expose	Motion
.VS
ButtonRelease	FocusIn	MouseWheel	
.VE
Circulate	FocusOut	Property
d173 4
a176 3
Configure	KeyPress, Key	Unmap
Deactivate	KeyRelease	Visibility
Destroy	Leave\fR
d293 7
d307 2
a308 1
The \fIheight\fR field from the event.  Valid for the \fBConfigure\fR and
d311 3
d330 1
a330 1
for \fBCirculate\fR events.
d344 2
a345 1
\fBConfigure\fR and \fBExpose\fR events.
d361 1
a361 1
\fBConfigure\fR events.
d431 1
a431 1
.SH MULTIPLE MATCHES
a450 1
.VS
a463 1
.VS
a489 1
.VE
@


1.5.6.1
log
@merged with trunk at tag macosx-8-4-merge-2002-08-20-trunk
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id$
d165 1
a165 1
.DS
d167 6
a172 5
\fBActivate	Destroy	Map
ButtonPress, Button	Enter	MapRequest
ButtonRelease	Expose	Motion
Circulate	FocusIn	MouseWheel	
CirculateRequest	FocusOut	Property
d174 3
a176 4
Configure	KeyPress, Key	ResizeRequest
ConfigureRequest	KeyRelease	Unmap
Create	Leave	Visibility
Deactivate\fR
a292 7
For \fBConfigureRequest\fR events, the string will be one of:
.DS
.ta 6c
\fBAbove	Opposite
Below	None
BottomIf	TopIf\fR
.DE
d300 1
a300 2
The \fIheight\fR field from the event.  Valid for the \fBConfigure\fR,
\fBConfigureRequest\fR, \fBCreate\fR, \fBResizeRequest\fR, and
a302 3
.IP \fB%i\fR 5
The \fIwindow\fR field from the event, represented as a hexadecimal
integer.
d319 1
a319 1
for \fBCirculate\fR and \fBCirculateRequest\fR events.
d333 1
a333 2
\fBConfigure\fR, \fBConfigureRequest\fR, \fBCreate\fR,
\fBResizeRequest\fR, and \fBExpose\fR events.
d349 1
a349 1
\fBConfigure\fR, \fBConfigureRequest\fR, and \fBCreate\fR events.
d419 1
a419 1
.SH "MULTIPLE MATCHES"
d439 1
d453 1
d480 1
@


1.4
log
@* doc/keysyms.n: Man page enumerating keysyms [RFE: 1645].

* doc/colors.n: Man page enumerating valid color names [RFE: 1645].

* doc/cursors.n: Man page enumerating valid cursor values [RFE: 1645].

* library/msgbox.tcl: Corrected Unix tk_messageBox implementation
to make the first button the default when no default is specified
[Bug: 2218].

* doc/messageBox.n: Updated documentation with regards to
selection of default button when none is specified (now it will
use the first button as the default in that case) [Bug: 2218].
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.3 1998/10/10 00:30:35 rjohnson Exp $
d122 1
a122 1
\fBMod1, M1\fR
d148 9
a156 10
The \fBDouble\fR and \fBTriple\fR modifiers are a convenience
for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be
repeated 2 or 3 times, and also place a time and space requirement
on the sequence:  for a sequence of events to match a \fBDouble\fR
or \fBTriple\fR pattern, all of the events must occur close together
in time and without substantial mouse motion in between.
For example, \fB<Double-Button-1>\fR
is equivalent to \fB<Button-1><Button-1>\fR with the extra
time and space requirement.
@


1.3
log
@
Added support for the MouseWheel event.
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.2 1998/09/14 18:22:54 stanton Exp $
d520 1
a520 1
bgerror
@


1.3.18.1
log
@doc cleanup and clarifications from 8.4aCVS backport
@
text
@d9 1
a9 1
'\" RCS: @@(#) $Id: bind.n,v 1.5 2000/05/23 00:31:36 hobbs Exp $
d122 1
a122 1
\fBMod1, M1\fR	\fBQuadruple\fR
d148 10
a157 9
The \fBDouble\fR, \fBTriple\fR and \fBQuadruple\fR modifiers are a
convenience for specifying double mouse clicks and other repeated
events. They cause a particular event pattern to be repeated 2, 3 or 4
times, and also place a time and space requirement on the sequence: for a
sequence of events to match a \fBDouble\fR, \fBTriple\fR or \fBQuadruple\fR
pattern, all of the events must occur close together in time and without
substantial mouse motion in between.  For example, \fB<Double-Button-1>\fR
is equivalent to \fB<Button-1><Button-1>\fR with the extra time and space
requirement.
d520 1
a520 1
bgerror, keysyms
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d4 1
d9 1
a9 1
'\" RCS: @@(#) $Id$
d12 1
a12 1
.TH bind n 4.1 Tk "Tk Built-In Commands"
d162 4
a165 2
few extra abbreviations.  Below is a list of all the valid types;
where two names appear together, they are synonyms.
d168 6
a173 3
\fBButtonPress, Button	Expose	Map
ButtonRelease	FocusIn	Motion
Circulate	FocusOut	Property	
d176 2
a177 3
Destroy	KeyRelease	Visibility
Enter	Leave	Activate
Deactivate\fR
d180 35
d301 1
a301 1
The \fIheight\fR field from the event.  Valid only for \fBConfigure\fR and
d351 9
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
'\" SCCS: @@(#) bind.n 1.41 96/10/03 18:27:05
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: bind.n,v 1.2 1998/09/14 18:22:54 stanton Exp $
@


1.1.4.2
log
@* integrated tk8.0.4 changes.

* generic/tkBind.c: fixed deletion order bug where a crash would
result if a binding deleted "."
@
text
@a3 1
'\" Copyright (c) 1998 by Scriptics Corporation.
d8 1
a8 1
'\" RCS: @@(#) $Id: bind.n,v 1.1.4.1 1998/09/30 02:16:11 stanton Exp $
d11 1
a11 1
.TH bind n 8.0 Tk "Tk Built-In Commands"
d161 2
a162 4
few extra abbreviations.  The \fItype\fR field will also accept a
couple non-standard X event types that were added to better support
the Macintosh and Windows platforms.  Below is a list of all the valid
types; where two names appear together, they are synonyms.
d165 3
a167 6
\fBActivate	Enter	Map
ButtonPress, Button	Expose	Motion
.VS
ButtonRelease	FocusIn	MouseWheel	
.VE
Circulate	FocusOut	Property
d170 3
a172 2
Deactivate	KeyRelease	Visibility
Destroy	Leave\fR
a174 35
.VS
Most of the above events have the same fields and behaviors as events
in the X Windowing system.  You can find more detailed descriptions of
these events in any X window programming book.  A couple of the events
are extensions to the X event system to support features unique to the
Macintosh and Windows platforms.  We provide a little more detail on
these events here.  These include:
.IP \fBActivate\fR 5
.IP \fBDeactivate\fR 5
These two events are sent to every sub-window of a toplevel when they
change state.  In addition to the focus Window, the Macintosh platform
and Windows platforms have a notion of an active window (which often
has but is not required to have the focus).  On the Macintosh, widgets
in the active window have a different appearance than widgets in
deactive windows.  The \fBActivate\fR event is sent to all the
sub-windows in a toplevel when it changes from being deactive to
active.  Likewise, the \fBDeactive\fR event is sent when the window's
state changes from active to deactive.  There are no useful percent
substitutions you would make when binding to these events.
.IP \fBMouseWheel\fR 5
Some mice on the Windows platform support a mouse wheel which is used
for scrolling documents without using the scrollbars.  By rolling the
wheel, the system will generate \fBMouseWheel\fR events that the
application can use to scroll.  Like \fBKey\fR events the event is
always routed to the window that currently has focus. When the event
is received you can use the \fB%D\fR substitution to get the
\fIdelta\fR field for the event which is a integer value of motion
that the mouse wheel has moved.  The smallest value for which the
system will report is defined by the OS.  On Windows 95 & 98 machines
this value is at least 120 before it is reported.  However, higher
resolution devices may be available in the future.  The sign of the
value determines which direction your widget should scroll.  Positive
values should scroll up and negative values should scroll down.
.VE
.PP
d261 1
a261 1
The \fIheight\fR field from the event.  Valid for the \fBConfigure\fR and
a310 9
.VS
.IP \fB%D\fR 5
This reports the \fIdelta\fR value of a \fBMouseWheel\fR event.  The
\fIdelta\fR value represents the rotation units the mouse wheel has
been moved.  On Windows 95 & 98 systems the smallest value for the
delta is 120.  Future systems may support higher resolution values for
the delta.  The sign of the value represents the direction the mouse
wheel was scrolled.
.VE
@


