NAME

bind - Arrange for X events to invoke Tcl scripts.

SYNOPSIS

bind widget-ID signal script

OPTIONS

DESCRIPTION

script is evaluated at global scope whenever widget or canvas item widget-ID receives signal signal. If script is the empty string, the binding is deleted.
Valid signals are: enter, leave, motion, button (synonym for buttonPress), buttonPress, buttonRelease, key (synonym for keyPress), keyPress, or keyRelease.
For button, buttonPress and buttonRelease signal can be a list "signal number", where number is an integer describing the button number.
For key, keyPress and keyRelease signal can be a list "signal detail". If detail starts with a "#" the following characters must be the name of a keysym symbol as defined in gdkkeysyms.h without the preceeding "GDK_" otherwise detail is the ASCII representation of a key. Example:
"key 1" binds on a key, that produces the ASCII value "1" be it on the numpad or on the keyboard.
"key #1" binds on the key with the symbol "1" that is on the "1" on the keyboard.
"key #KP_1" binds on the key with the symbol "KP_1" that is on the "1" on the numpad if Num is on.

Before evaluating every percent (%) and its following character is substituted in script:
%% by %
%A by the ASCII representation of the key that was pressed or released
%b by the number of the button that was pressed or released
%k by the keysym as integer of the key that was pressed or released
%K by the keysym as symbol of the key that was pressed or released
%s by the state of the modifier keys as bitfield
%x by the x coordinate of the event
%y by the y coordinate of the event


WIDGET COMMANDS

KEYWORDS


Copyright © 2001 - 2002 P. G. Baum