head	1.23;
access;
symbols
	core-8-5-9:1.19
	core-8-5-8:1.19
	macosx-cocoa-merge:1.22
	macosx-cocoa-premerge:1.22
	macosx-carbon-freeze:1.22
	core-8-5-7:1.19
	core-8-5-6:1.19
	core-8-6-b1:1.21
	core-8-6-a3:1.21
	core-8-5-5:1.19
	core-8-6-a2:1.20
	core-8-5-4:1.19
	core-8-5-3:1.19
	core-8-6-a1:1.19
	core-8-4-19:1.6.8.1
	core-8-5-branch:1.19.0.2
	core-8-5-2:1.19
	core-8-4-18:1.6.8.1
	core-8-5-1:1.19
	core-8-4-17:1.6.8.1
	core-8-5-0:1.19
	core-8-5-b3:1.17
	core-8-5-b2:1.14
	core-8-4-16:1.6.8.1
	core-8-5-b1:1.12
	core-stablilizer-merge:1.12
	core-stabilizer-branch:1.12.0.2
	core-stabilizer-merge:1.19
	core-8-4-15:1.6.8.1
	core-8-5-a6:1.12
	core-8-5-a5:1.12
	core-8-4-14:1.6.8.1
	core-8-5-a4:1.12
	core-8-4-13:1.6.8.1
	core-8-4-12:1.6.8.1
	core-8-4-11:1.6.8.1
	core-8-5-a3:1.12
	core-8-4-10:1.6.8.1
	core-8-4-9-branch:1.6.8.1.0.2
	core-8-5-a2:1.10
	core-8-4-9:1.6.8.1
	core-8-4-8:1.6.8.1
	core-8-4-7:1.6
	core-8-5-a1:1.6
	core-8-4-6:1.6
	core-8-4-5:1.6
	mistachkin-dev-branch:1.6.0.10
	core-8-4-4:1.6
	core-8-4-3:1.6
	core-8-4-branch:1.6.0.8
	core-8-4-2:1.6
	core-8-4-1:1.6
	core-8-3-5:1.5.2.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.6
	macosx-8-4-premerge-2002-08-31-trunk:1.6
	macosx-8-4-merge-2002-08-30-branch:1.6
	macosx-8-4-merge-2002-08-30-trunk:1.6
	macosx-8-4-merge-2002-08-20-branch:1.6
	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.6
	core-8-4-a4:1.6
	core-8-3-4:1.5.2.1
	macosx-8-4-branch:1.6.0.6
	macosx-8-4-branchpoint:1.6
	core-8-4-a3:1.6
	core-8-3-3:1.5.2.1
	dgp-privates-into-namespace:1.6.0.4
	tclpro-1-5-0:1.5
	core-8-4-win-speedup:1.6.0.2
	core-8-4-a2:1.6
	tclpro-1-4-1:1.5
	tclpro-1-4-0:1.5
	core-8-3-2:1.5
	ajuba-ajuba2-2-1-base:1.5
	ajuba-ajuba2-2-0:1.5
	core-8-4-a1:1.5
	core-8-3-1-branch:1.5.0.2
	core-8-3-1:1.5
	scriptics-sc-2-0-b5:1.5
	scriptics-sc-2-0-fixed:1.5
	scriptics-sc-2-0-b2:1.5
	scriptics-sc-2-0-b1:1.5
	core-8-3-0:1.5
	core-8-3-b2:1.5
	core-8-3-b1:1.4
	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.23
date	2010.01.06.18.37.36;	author dkf;	state Exp;
branches;
next	1.22;

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

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

1.20
date	2008.06.30.22.57.02;	author dkf;	state Exp;
branches;
next	1.19;

1.19
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches;
next	1.18;

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

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

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

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

1.14
date	2007.10.26.20.13.23;	author dgp;	state Exp;
branches;
next	1.13;

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

1.12
date	2005.04.06.21.11.54;	author dkf;	state Exp;
branches
	1.12.2.1;
next	1.11;

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

1.10
date	2004.08.29.09.27.35;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2004.08.20.10.56.36;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2004.06.18.21.18.37;	author dkf;	state Exp;
branches;
next	1.7;

1.7
date	2004.03.25.12.12.36;	author vincentdarley;	state Exp;
branches;
next	1.6;

1.6
date	2000.11.03.01.13.51;	author hobbs;	state Exp;
branches
	1.6.8.1;
next	1.5;

1.5
date	2000.01.13.02.07.08;	author hobbs;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	99.12.14.06.51.44;	author hobbs;	state Exp;
branches;
next	1.3;

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

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

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

1.1.4.1
date	98.09.30.02.16.16;	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.5.2.1
date	2001.04.04.07.23.48;	author hobbs;	state Exp;
branches;
next	;

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

1.12.2.1
date	2007.11.01.16.37.14;	author dgp;	state Exp;
branches;
next	1.12.2.2;

1.12.2.2
date	2007.11.02.14.51.39;	author dgp;	state Exp;
branches;
next	1.12.2.3;

1.12.2.3
date	2007.12.12.14.13.09;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.23
log
@Centralize the definitions of what keys do particular types of left and right
movements in entries and text widgets. They vary between platforms!
@
text
@'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\" Copyright (c) 1998-2000 Ajuba Solutions.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: event.n,v 1.22 2009/03/10 11:13:53 dkf Exp $
'\" 
.so man.macros
.TH event n 8.3 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
event \- Miscellaneous event facilities: define virtual events and generate events
.SH SYNOPSIS
\fBevent\fI option \fR?\fIarg arg ...\fR?
.BE
.SH DESCRIPTION
.PP
The \fBevent\fR command provides several facilities for dealing with
window system events, such as defining virtual events and synthesizing
events.  The command has several different forms, determined by the
first argument.  The following forms are currently supported:
.TP
\fBevent add <<\fIvirtual\fB>>\fI sequence \fR?\fIsequence ...\fR?
Associates the virtual event \fIvirtual\fR with the physical
event sequence(s) given by the \fIsequence\fR arguments, so that
the virtual event will trigger whenever any one of the \fIsequence\fRs
occurs.
\fIVirtual\fR may be any string value and \fIsequence\fR may have
any of the values allowed for the \fIsequence\fR argument to the
\fBbind\fR command.
If \fIvirtual\fR is already defined, the new physical event sequences
add to the existing sequences for the event.
.TP
\fBevent delete <<\fIvirtual\fB>> \fR?\fIsequence\fR \fIsequence ...\fR?
Deletes each of the \fIsequence\fRs from those associated with
the virtual event given by \fIvirtual\fR.
\fIVirtual\fR may be any string value and \fIsequence\fR may have
any of the values allowed for the \fIsequence\fR argument to the
\fBbind\fR command.
Any \fIsequence\fRs not currently associated with \fIvirtual\fR
are ignored.
If no \fIsequence\fR argument is provided, all physical event sequences
are removed for \fIvirtual\fR, so that the virtual event will not
trigger anymore.
.TP
\fBevent generate \fIwindow event \fR?\fIoption value option value ...\fR?
Generates a window event and arranges for it to be processed just as if
it had come from the window system.
\fIWindow\fR gives the path name of the window for which the event
will be generated; it may also be an identifier (such as returned by
\fBwinfo id\fR) as long as it is for a window in the current application.
\fIEvent\fR provides a basic description of
the event, such as \fB<Shift-Button-2>\fR or \fB<<Paste>>\fR.
If \fIWindow\fR is empty the whole screen is meant, and coordinates
are relative to the screen.
\fIEvent\fR may have any of the forms allowed for the \fIsequence\fR
argument of the \fBbind\fR command except that it must consist
of a single event pattern, not a sequence.
\fIOption-value\fR pairs may be used to specify additional
attributes of the event, such as the x and y mouse position;  see
\fBEVENT FIELDS\fR below.  If the \fB\-when\fR option is not specified, the
event is processed immediately:  all of the handlers for the event
will complete before the \fBevent generate\fR command returns.
If the \fB\-when\fR option is specified then it determines when the
event is processed.  Certain events, such as key events, require
that the window has focus to receive the event properly.
.TP
\fBevent info \fR?\fB<<\fIvirtual\fB>>\fR?
Returns information about virtual events.
If the \fB<<\fIvirtual\fB>>\fR argument is omitted, the return value
is a list of all the virtual events that are currently defined.
If \fB<<\fIvirtual\fB>>\fR is specified then the return value is
a list whose elements are the physical event sequences currently
defined for the given virtual event;  if the virtual event is
not defined then an empty string is returned.
.RS
.PP
Note that virtual events that that are not bound to physical event
sequences are \fInot\fR returned by \fBevent info\fR.
.RE
.SH "EVENT FIELDS"
.PP
The following options are supported for the \fBevent generate\fR
command.  These correspond to the
.QW %
expansions allowed in binding scripts for the \fBbind\fR command.
.TP
\fB\-above\fI window\fR
\fIWindow\fR specifies the \fIabove\fR field for the event,
either as a window path name or as an integer window id.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%a\fR substitution for binding scripts.
.TP
\fB\-borderwidth\fI size\fR
\fISize\fR must be a screen distance;  it specifies the
\fIborder_width\fR field for the event.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%B\fR substitution for binding scripts.
.TP
\fB\-button\fI number\fR
\fINumber\fR must be an integer;  it specifies the \fIdetail\fR field
for a \fBButtonPress\fR or \fBButtonRelease\fR event, overriding
any button  number provided in the base \fIevent\fR argument.
Corresponds to the \fB%b\fR substitution for binding scripts.
.TP
\fB\-count\fI number\fR
\fINumber\fR must be an integer;  it specifies the \fIcount\fR field
for the event.  Valid for \fBExpose\fR events.
Corresponds to the \fB%c\fR substitution for binding scripts.
.TP
\fB\-data\fI string\fR
\fIString\fR may be any value; it specifies the \fIuser_data\fR field
for the event.  Only valid for virtual events.  Corresponds to the
\fB%d\fR substitution for virtual events in binding scripts.
.TP
\fB\-delta\fI number\fR
\fINumber\fR must be an integer;  it specifies the \fIdelta\fR field
for the \fBMouseWheel\fR event.  The \fIdelta\fR refers to the
direction and magnitude the mouse wheel was rotated.  Note the value
is not a screen distance but are units of motion in the mouse wheel.
Typically these values are multiples of 120.  For example, 120 should
scroll the text widget up 4 lines and \-240 would scroll the text
widget down 8 lines.  Of course, other widgets may define different
behaviors for mouse wheel motion.  This field corresponds to the
\fB%D\fR substitution for binding scripts.
.TP
\fB\-detail\fI detail\fR
\fIDetail\fR specifies the \fIdetail\fR field for the event
and must 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
Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR and
\fBFocusOut\fR events.
Corresponds to the \fB%d\fR substitution for binding scripts.
.RE
.TP
\fB\-focus\fI boolean\fR
\fIBoolean\fR must be a boolean value;  it specifies the \fIfocus\fR
field for the event.
Valid for \fBEnter\fR and \fBLeave\fR events.
Corresponds to the \fB%f\fR substitution for binding scripts.
.TP
\fB\-height\fI size\fR
\fISize\fR must be a screen distance;  it specifies the \fIheight\fR
field for the event.  Valid for \fBConfigure\fR events.
Corresponds to the \fB%h\fR substitution for binding scripts.
.TP
\fB\-keycode\fI number\fR
\fINumber\fR  must be an integer;  it specifies the \fIkeycode\fR
field for the event.
Valid for \fBKeyPress\fR and \fBKeyRelease\fR events.
Corresponds to the \fB%k\fR substitution for binding scripts.
.TP
\fB\-keysym\fI name\fR
\fIName\fR must be the name of a valid keysym, such as \fBg\fR,
\fBspace\fR, or \fBReturn\fR;  its corresponding
keycode value is used as the \fIkeycode\fR field for event, overriding
any detail specified in the base \fIevent\fR argument.
Valid for \fBKeyPress\fR and \fBKeyRelease\fR events.
Corresponds to the \fB%K\fR substitution for binding scripts.
.TP
\fB\-mode\fI notify\fR
\fINotify\fR specifies the \fImode\fR field for the event and must be
one of \fBNotifyNormal\fR, \fBNotifyGrab\fR, \fBNotifyUngrab\fR, or
\fBNotifyWhileGrabbed\fR.
Valid for \fBEnter\fR, \fBLeave\fR, \fBFocusIn\fR, and
\fBFocusOut\fR events.
Corresponds to the \fB%m\fR substitution for binding scripts.  
.TP
\fB\-override\fI boolean\fR
\fIBoolean\fR must be a boolean value;  it specifies the
\fIoverride_redirect\fR field for the event.
Valid for \fBMap\fR, \fBReparent\fR, and \fBConfigure\fR events.
Corresponds to the \fB%o\fR substitution for binding scripts.
.TP
\fB\-place\fI where\fR
\fIWhere\fR specifies the \fIplace\fR field for the event;  it must be
either \fBPlaceOnTop\fR or \fBPlaceOnBottom\fR.
Valid for \fBCirculate\fR events.
Corresponds to the \fB%p\fR substitution for binding scripts.
.TP
\fB\-root\fI window\fR
\fIWindow\fR must be either a window path name or an integer window
identifier;  it specifies the \fIroot\fR field for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events.
Corresponds to the \fB%R\fR substitution for binding scripts.
.TP
\fB\-rootx\fI coord\fR
\fICoord\fR must be a screen distance;  it specifies the \fIx_root\fR
field for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events.  Corresponds to the \fB%X\fR substitution for binding scripts.
.TP
\fB\-rooty\fI coord\fR
\fICoord\fR must be a screen distance;  it specifies the \fIy_root\fR
field for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR
events.
Corresponds to the \fB%Y\fR substitution for binding scripts.
.TP
\fB\-sendevent\fI boolean\fR
\fIBoolean\fR must be a boolean value;  it specifies the \fIsend_event\fR
field for the event.  Valid for all events.  Corresponds to the
\fB%E\fR substitution for binding scripts.
.TP
\fB\-serial\fI number\fR
\fINumber\fR must be an integer;  it specifies the \fIserial\fR field
for the event.  Valid for all events.
Corresponds to the \fB%#\fR substitution for binding scripts.
.TP
\fB\-state\fI state\fR
\fIState\fR specifies the \fIstate\fR field for the event.
For \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events
it must be an integer value.
For \fBVisibility\fR events it must be one of \fBVisibilityUnobscured\fR, 
\fBVisibilityPartiallyObscured\fR, or \fBVisibilityFullyObscured\fR.
This option overrides any modifiers such as \fBMeta\fR or \fBControl\fR
specified in the base \fIevent\fR.
Corresponds to the \fB%s\fR substitution for binding scripts.
.TP
\fB\-subwindow\fI window\fR
\fIWindow\fR specifies the \fIsubwindow\fR field for the event, either
as a path name for a Tk widget or as an integer window identifier.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, and \fBMotion\fR events.
Similar to \fB%S\fR substitution for binding scripts.
.TP
\fB\-time\fI integer\fR
\fIInteger\fR must be an integer value;  it specifies the \fItime\fR field
for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBEnter\fR, \fBLeave\fR, \fBMotion\fR,
and \fBProperty\fR events.
Corresponds to the \fB%t\fR substitution for binding scripts.
.TP
\fB\-warp\fI boolean\fR
\fIboolean\fR must be a boolean value;  it specifies whether
the screen pointer should be warped as well.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, and \fBMotion\fR events.  The pointer will
only warp to a window if it is mapped.
.TP
\fB\-width\fI size\fR
\fISize\fR must be a screen distance;  it specifies the \fIwidth\fR field
for the event.
Valid for \fBConfigure\fR events.
Corresponds to the \fB%w\fR substitution for binding scripts.
.TP
\fB\-when\fI when\fR
\fIWhen\fR determines when the event will be processed;  it must have one
of the following values:
.RS
.IP \fBnow\fR 10
Process the event immediately, before the command returns.
This also happens if the \fB\-when\fR option is omitted.
.IP \fBtail\fR 10
Place the event on Tcl's event queue behind any events already
queued for this application.
.IP \fBhead\fR 10
Place the event at the front of Tcl's event queue, so that it
will be handled before any other events already queued.
.IP \fBmark\fR 10
Place the event at the front of Tcl's event queue but behind any
other events already queued with \fB\-when mark\fR.
This option is useful when generating a series of events that should
be processed in order but at the front of the queue.
.RE
.TP
\fB\-x\fI coord\fR
\fICoord\fR must be a screen distance;  it specifies the \fIx\fR field
for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR,
\fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR
events.
Corresponds to the \fB%x\fR substitution for binding scripts.
If \fIWindow\fR is empty the coordinate is relative to the
screen, and this option corresponds to the \fB%X\fR substitution
for binding scripts.
.TP
\fB\-y\fI coord\fR
\fICoord\fR must be a screen distance;  it specifies the \fIy\fR
field for the event.
Valid for \fBKeyPress\fR, \fBKeyRelease\fR, \fBButtonPress\fR,
\fBButtonRelease\fR, \fBMotion\fR, \fBEnter\fR, \fBLeave\fR,
\fBExpose\fR, \fBConfigure\fR, \fBGravity\fR, and \fBReparent\fR
events.
Corresponds to the \fB%y\fR substitution for binding scripts.
If \fIWindow\fR is empty the coordinate is relative to the
screen, and this option corresponds to the \fB%Y\fR substitution
for binding scripts.
.PP
Any options that are not specified when generating an event are filled 
with the value 0, except for \fIserial\fR, which is filled with the 
next X event serial number.  
.SH "PREDEFINED VIRTUAL EVENTS"
.PP
Tk defines the following virtual events for the purposes of
notification:
.TP
\fB<<AltUnderlined>>\fR
This is sent to widget to notify it that the letter it has underlined
(as an accelerator indicator) with the \fB\-underline\fR option has
been pressed in combination with the Alt key. The usual response to
this is to either focus into the widget (or some related widget) or to
invoke the widget.
.TP
\fB<<ListboxSelect>>\fR
This is sent to a listbox when the set of selected item(s) in the
listbox is updated.
.TP
\fB<<MenuSelect>>\fR
This is sent to a menu when the currently selected item in the menu
changes. It is intended for use with context-sensitive help systems.
.TP
\fB<<Modified>>\fR
This is sent to a text widget when the contents of the widget are
changed.
.TP
\fB<<Selection>>\fR
This is sent to a text widget when the selection in the widget is
changed.
.TP
\fB<<TraverseIn>>\fR
This is sent to a widget when the focus enters the widget because of a
user-driven
.QW "tab to widget"
action.
.TP
\fB<<TraverseOut>>\fR
This is sent to a widget when the focus leaves the widget because of a
user-driven
.QW "tab to widget"
action.
.PP
Tk defines the following virtual events for the purposes of unifying
bindings across multiple platforms. Users expect them to behave in the
following way:
.TP
\fB<<Clear>>\fR
Delete the currently selected widget contents.
.TP
\fB<<Copy>>\fR
Copy the currently selected widget contents to the clipboard.
.TP
\fB<<Cut>>\fR
Move the currently selected widget contents to the clipboard.
.TP
\fB<<LineEnd>>\fR
.
Move to the end of the line in the current widget while deselecting any
selected contents.
.TP
\fB<<LineStart>>\fR
.
Move to the start of the line in the current widget while deselecting any
selected contents.
.TP
\fB<<NextChar>>\fR
.
Move to the next item (i.e., visible character) in the current widget while
deselecting any selected contents.
.TP
\fB<<NextWord>>\fR
.
Move to the next group of items (i.e., visible word) in the current widget
while deselecting any selected contents.
.TP
\fB<<Paste>>\fR
Replace the currently selected widget contents with the contents of
the clipboard.
.TP
\fB<<PasteSelection>>\fR
Insert the contents of the selection at the mouse location. (This
event has meaningful \fB%x\fR and \fB%y\fR substitutions).
.TP
\fB<<PrevChar>>\fR
.
Move to the previous item (i.e., visible character) in the current widget
while deselecting any selected contents.
.TP
\fB<<PrevWindow>>\fR
Traverse to the previous window.
.TP
\fB<<PrevWord>>\fR
.
Move to the previous group of items (i.e., visible word) in the current widget
while deselecting any selected contents.
.TP
\fB<<Redo>>\fR
Redo one undone action.
.TP
\fB<<SelectLineEnd>>\fR
.
Move to the end of the line in the current widget while extending the range
of selected contents.
.TP
\fB<<SelectLineStart>>\fR
.
Move to the start of the line in the current widget while extending the range
of selected contents.
.TP
\fB<<SelectNextChar>>\fR
.
Move to the next item (i.e., visible character) in the current widget while
extending the range of selected contents.
.TP
\fB<<SelectNextWord>>\fR
.
Move to the next group of items (i.e., visible word) in the current widget
while extending the range of selected contents.
.TP
\fB<<SelectPrevChar>>\fR
.
Move to the previous item (i.e., visible character) in the current widget
while extending the range of selected contents.
.TP
\fB<<SelectPrevWord>>\fR
.
Move to the previous group of items (i.e., visible word) in the current widget
while extending the range of selected contents.
.TP
\fB<<Undo>>\fR
Undo the last action.
.SH EXAMPLES
.SS "MAPPING KEYS TO VIRTUAL EVENTS"
.PP
In order for a virtual event binding to trigger, two things must
happen.  First, the virtual event must be defined with the
\fBevent add\fR command.  Second, a binding must be created for
the virtual event with the \fBbind\fR command.
Consider the following virtual event definitions:
.PP
.CS
\fBevent add\fR <<Paste>> <Control-y>
\fBevent add\fR <<Paste>> <Button-2>
\fBevent add\fR <<Save>> <Control-X><Control-S>
\fBevent add\fR <<Save>> <Shift-F12>
if {[tk windowingsystem] eq "aqua"} {
    \fBevent add\fR <<Save>> <Command-s>
}
.CE
.PP
In the \fBbind\fR command, a virtual event can be bound like any other
builtin event type as follows:
.PP
.CS
bind Entry <<Paste>> {%W insert [selection get]}
.CE
.PP
The double angle brackets are used to specify that a virtual event is being
bound.  If the user types Control-y or presses button 2, or if
a \fB<<Paste>>\fR virtual event is synthesized with \fBevent generate\fR,
then the \fB<<Paste>>\fR binding will be invoked.
.PP
If a virtual binding has the exact same sequence as a separate
physical binding, then the physical binding will take precedence.
Consider the following example:
.PP
.CS
\fBevent add\fR <<Paste>> <Control-y> <Meta-Control-y>
bind Entry <Control-y> {puts Control-y}
bind Entry <<Paste>> {puts Paste}
.CE
.PP
When the user types Control-y the \fB<Control-y>\fR binding
will be invoked, because a physical event is considered
more specific than a virtual event, all other things being equal.
However, when the user types Meta-Control-y the
\fB<<Paste>>\fR binding will be invoked, because the
\fBMeta\fR modifier in the physical pattern associated with the 
virtual binding is more specific than the \fB<Control-y\fR> sequence for
the physical event.
.PP
Bindings on a virtual event may be created before the virtual event exists.
Indeed, the virtual event never actually needs to be defined, for instance,
on platforms where the specific virtual event would meaningless or
ungeneratable.
.PP
When a definition of a virtual event changes at run time, all windows
will respond immediately to the new definition.
Starting from the preceding example, if the following code is executed:
.PP
.CS
bind Entry <Control-y> {}
\fBevent add\fR <<Paste>> <Key-F6>
.CE
.PP
the behavior will change such in two ways.  First, the shadowed
\fB<<Paste>>\fR binding will emerge.
Typing Control-y will no longer invoke the \fB<Control-y>\fR binding, 
but instead invoke the virtual event \fB<<Paste>>\fR.  Second,
pressing the F6 key will now also invoke the \fB<<Paste>>\fR binding.
.SS "MOVING THE MOUSE POINTER"
.PP
Sometimes it is useful to be able to really move the mouse pointer. For
example, if you have some software that is capable of demonstrating directly
to the user how to use the program. To do this, you need to
.QW warp
the mouse around by using \fBevent generate\fR, like this:
.PP
.CS
for {set xy 0} {$xy < 200} {incr xy} {
    \fBevent generate\fR . <Motion> -x $xy -y $xy -warp 1
    update
    after 50
}
.CE
.PP
Note that it is usually considered bad style to move the mouse pointer for the
user because it removes control from them. Therefore this technique should be
used with caution. Also note that it is not guaranteed to function on all
platforms.
.SH "SEE ALSO"
bind(n)
.SH KEYWORDS
event, binding, define, handle, virtual event
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.22
log
@Tidy up and expand examples.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.21 2008/09/23 13:36:39 dkf Exp $
d363 20
d391 5
d399 5
d407 30
d453 3
@


1.21
log
@Fix [Bug 2118116]
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.20 2008/06/30 22:57:02 dkf Exp $
d379 2
a380 1
.SH "VIRTUAL EVENT EXAMPLES"
d387 1
d389 4
a392 4
event add <<Paste>> <Control-y>
event add <<Paste>> <Button-2>
event add <<Save>> <Control-X><Control-S>
event add <<Save>> <Shift-F12>
d394 1
d397 1
d401 1
d410 1
d412 1
a412 1
event add <<Paste>> <Control-y> <Meta-Control-y>
d416 1
d434 1
d436 2
a437 2
bind <Entry> <Control-y> {}
event add <<Paste>> <Key-F6>
d439 1
d445 20
@


1.20
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.19 2007/12/13 15:23:43 dgp Exp $
d440 3
@


1.19
log
@merge stable branch onto HEAD
@
text
@d1 1
d9 1
a9 1
'\" RCS: @@(#) $Id: event.n,v 1.12.2.3 2007/12/12 14:13:09 dgp Exp $
a113 1
.VS 8.5
a118 1
.VE 8.5
d312 1
a436 1

a438 1

@


1.18
log
@Clarify docs to note that [event info] isn't clairvoyant.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.17 2007/11/01 23:03:54 dkf Exp $
@


1.17
log
@Fix .DS/.DE to work better when transformed to a table
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.16 2007/10/30 21:29:59 dkf Exp $
d79 5
@


1.16
log
@More documentation improvements
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.15 2007/10/29 16:04:13 dkf Exp $
d133 4
a136 4
\fBNotifyAncestor	NotifyNonlinearVirtual
NotifyDetailNone	NotifyPointer
NotifyInferior	NotifyPointerRoot
NotifyNonlinear	NotifyVirtual\fR
@


1.15
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.14 2007/10/26 20:13:23 dgp Exp $
a18 1

d71 1
a71 1
\fBevent info \fR?<<\fIvirtual\fB>>\fR?
@


1.14
log
@        * doc/*.1:              Revert doc changes that broke
        * doc/*.3:              `make html` so we can get the release
        * doc/*.n:              out the door.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.12 2005/04/06 21:11:54 dkf Exp $
d65 1
a65 1
EVENT FIELDS below.  If the \fB\-when\fR option is not specified, the
d83 3
a85 2
command.  These correspond to the ``%'' expansions
allowed in binding scripts for the \fBbind\fR command.
d123 1
a123 1
scroll the text widget up 4 lines and -240 would scroll the text
d337 3
a339 1
user-driven "tab to widget" action.
d343 3
a345 1
user-driven "tab to widget" action.
@


1.13
log
@Lots of improvements to look and feel of manual pages
@
text
@d83 2
a84 3
command.  These correspond to the
.QW %
expansions allowed in binding scripts for the \fBbind\fR command.
@


1.12
log
@Purge old and inaccurate .VS/.VE macros.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.11 2005/01/12 11:03:33 dkf Exp $
d83 3
a85 2
command.  These correspond to the ``%'' expansions
allowed in binding scripts for the \fBbind\fR command.
@


1.12.2.1
log
@merge updates from HEAD
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.12 2005/04/06 21:11:54 dkf Exp $
d19 1
d65 1
a65 1
\fBEVENT FIELDS\fR below.  If the \fB\-when\fR option is not specified, the
d72 1
a72 1
\fBevent info \fR?\fB<<\fIvirtual\fB>>\fR?
d83 2
a84 3
command.  These correspond to the
.QW %
expansions allowed in binding scripts for the \fBbind\fR command.
d122 1
a122 1
scroll the text widget up 4 lines and \-240 would scroll the text
d336 1
a336 3
user-driven
.QW "tab to widget"
action.
d340 1
a340 3
user-driven
.QW "tab to widget"
action.
@


1.12.2.2
log
@merge updates from HEAD
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.12.2.1 2007/11/01 16:37:14 dgp Exp $
d133 4
a136 4
\fBNotifyAncestor\fR	\fBNotifyNonlinearVirtual\fR
\fBNotifyDetailNone\fR	\fBNotifyPointer\fR
\fBNotifyInferior\fR	\fBNotifyPointerRoot\fR
\fBNotifyNonlinear\fR	\fBNotifyVirtual\fR
@


1.12.2.3
log
@merge updates from HEAD
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.12.2.2 2007/11/02 14:51:39 dgp Exp $
a78 5
.RS
.PP
Note that virtual events that that are not bound to physical event
sequences are \fInot\fR returned by \fBevent info\fR.
.RE
@


1.11
log
@Added docs on predefined virtual events. [608115]
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.10 2004/08/29 09:27:35 dkf Exp $
a53 1
.VS 8.3
a55 1
.VE
@


1.10
log
@TIP#165 (user data field) implementation.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.9 2004/08/20 10:56:36 dkf Exp $
d309 64
@


1.9
log
@Spelling and grammar fixes from Mikhail Kolesnitchenko. [Patch 1012083]
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.8 2004/06/18 21:18:37 dkf Exp $
d110 7
@


1.8
log
@Minor formatting fix
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.7 2004/03/25 12:12:36 vincentdarley Exp $
d199 1
a199 1
\fICoord\fR must be a screen distance;  it specifies th \fIy_root\fR
d207 1
a207 1
\fBBoolean\fR must be a boolean value;  it specifies the \fIsend_event\fR
@


1.7
log
@Fix typos in documentation
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.6 2000/11/03 01:13:51 hobbs Exp $
a81 1

a301 1

d361 1
a361 1
bind
@


1.6
log
@doc/event.n: added note that key events require window focus.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.5 2000/01/13 02:07:08 hobbs Exp $
d283 1
a283 1
Corresponds to the the \fB%x\fR substitution for binding scripts.
d295 1
a295 1
Corresponds to the the \fB%y\fR substitution for binding scripts.
@


1.6.8.1
log
@Backport of documentation fixes
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.6 2000/11/03 01:13:51 hobbs Exp $
d82 1
d200 1
a200 1
\fICoord\fR must be a screen distance;  it specifies the \fIy_root\fR
d208 1
a208 1
\fIBoolean\fR must be a boolean value;  it specifies the \fIsend_event\fR
d283 1
a283 1
Corresponds to the \fB%x\fR substitution for binding scripts.
d295 1
a295 1
Corresponds to the \fB%y\fR substitution for binding scripts.
d303 1
d363 1
a363 1
bind(n)
@


1.5
log
@	* doc/event.n:
	* generic/tkBind.c: prevented core with event -warp on Windows
	when window wasn't mapped [Bug: 4004] and added docs stating
	the requirement for mapped windows.
@
text
@d3 1
a3 1
'\" Copyright (c) 1998 by Scriptics Corporation.
d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.4 1999/12/14 06:51:44 hobbs Exp $
d71 2
a72 1
event is processed.
@


1.5.2.1
log
@doc cleanup and clarifications from 8.4aCVS backport
@
text
@d3 1
a3 1
'\" Copyright (c) 1998-2000 Ajuba Solutions.
d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.6 2000/11/03 01:13:51 hobbs Exp $
d71 1
a71 2
event is processed.  Certain events, such as key events, require
that the window has focus to receive the event properly.
@


1.4
log
@	* doc/canvas.n: added docs for items added by dash patch (-*dash*,
	-state, -active*, -disabled*, -offset, essentially rewrote the
	man patch for completely updated 8.3 canvas widget.
	* doc/entry.n: added docs for entry widget validation
	* doc/event.n: added docs for -warp
	* doc/text.n: doc'ed new -state value 'hidden'
	* doc/GetDash.3: (new file) man page explaining Tk_GetDash
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.3 1998/10/10 00:30:35 rjohnson Exp $
d246 2
a247 1
\fBButtonRelease\fR, and \fBMotion\fR events.
@


1.3
log
@
Added support for the MouseWheel event.
@
text
@d8 1
a8 1
'\" RCS: @@(#) $Id: event.n,v 1.2 1998/09/14 18:22:55 stanton Exp $
d11 1
a11 1
.TH event n 8.0 Tk "Tk Built-In Commands"
d54 1
a54 1
.VS
d60 2
a111 1
.VS
a120 1
.VE
d242 6
d282 3
d294 3
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d3 1
d8 1
a8 1
'\" RCS: @@(#) $Id$
d11 1
a11 1
.TH event n 4.4 Tk "Tk Built-In Commands"
d108 13
@


1.1
log
@Initial revision
@
text
@d7 1
a7 1
'\" SCCS: @@(#) event.n 1.6 97/10/31 12:58:54
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: event.n,v 1.2 1998/09/14 18:22:55 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
@a2 1
'\" Copyright (c) 1998 by Scriptics Corporation.
d7 1
a7 1
'\" RCS: @@(#) $Id: event.n,v 1.1.4.1 1998/09/30 02:16:16 stanton Exp $
d10 1
a10 1
.TH event n 8.0 Tk "Tk Built-In Commands"
a106 13
.TP
\fB\-delta\fI number\fR
.VS
\fINumber\fR must be an integer;  it specifies the \fIdelta\fR field
for the \fBMouseWheel\fR event.  The \fIdelta\fR refers to the
direction and magnitude the mouse wheel was rotated.  Note the value
is not a screen distance but are units of motion in the mouse wheel.
Typically these values are multiples of 120.  For example, 120 should
scroll the text widget up 4 lines and -240 would scroll the text
widget down 8 lines.  Of course, other widgets may define different
behaviors for mouse wheel motion.  This field corresponds to the
\fB%D\fR substitution for binding scripts.
.VE
@


