Table 26-4 lists the percent keywords and the corresponding option to the event generate command. Remember that keyword substitutions occur throughout the command, regardless of other Tcl quoting conventions. Keep your binding commands short, introducing procedures if needed. For the details about various event fields, consult the Xlib Reference Manual (O'Reilly & Associates, Inc.). The string values for the keyword substitutions are listed after a short description of the keyword. If no string values are listed, the keyword has an integer value like a coordinate or a window ID.
%% | Use this to get a single percent sign. All events. | |
%# | -serial num | The serial number for the event. All events. |
%a | -above win | The above field from the event. Configure event. |
%b | -button num | Button number. Events: ButtonPress and ButtonRelease. |
%c | -count num | The count field. Events: Expose and Map. |
%d | -detail value | The detail field. Values: NotifyAncestor, NotifyNonlinearVirtual, NotifyDetailNone, NotifyPointer, NotifyInferior, NotifyPointerRoot, NotifyNonlinear, or NotifyVirtual. Events: Enter, Leave, FocusIn, and FocusOut. |
%f | -focus boolean | The focus field (0 or 1). Events: Enter and Leave. |
%h | -height num | The height field. Events: Configure and Expose. |
%k | -keycode num | The keycode field. Events: KeyPress and KeyRelease. |
%m | -mode value | The mode field. Values: NotifyNormal, NotifyGrab, NotifyUngrab, or NotifyWhileGrabbed. Events: Enter, Leave, FocusIn, and FocusOut. |
%o | -override boolean | The override_redirect field. Events: Map, Reparent, and Configure. |
%p | -place value | The place field. Values: PlaceOnTop, PlaceOnBottom. Circulate event. |
%s | -state value | The state field. A decimal string for events: ButtonPress, ButtonRelease, Enter, Leave, KeyPress, KeyRelease, and Motion. Values for the Visibility event: VisibilityUnobscured, VisibilityPartiallyObscured, or VisibilityFullyObscured. |
%t | -time num | The time field. All events. |
%v | The value_mask field. Configure event. | |
%w | -width num | The width field. Events: Configure and Expose. |
%x | -x pixel | The X coordinate, widget relative. Mouse events. |
%y | -y pixel | The Y coordinate, widget relative. Mouse events. |
%A | The printing character from the event, or {}. Events: KeyPress and KeyRelease. | |
%B | -borderwidth num | The border width. Configure event. |
%D | -delta value | The delta value. MouseWheel event. |
%E | -sendevent bool | The send_event field. All events. |
%K | -keysym symbol | The keysym from the event. Events: KeyPress and KeyRelease. |
%N | The keysym as a decimal number. Events: KeyPress and KeyRelease. | |
%R | -root win | The root window ID. All events. |
%S | -subwindow win | The subwindow ID. All events. |
%T | The type field. All events. | |
%W | The Tk pathname of the widget receiving the event. All events. | |
%X | -rootx pixel | The x_root field. Relative to the (virtual) root window. Events: ButtonPress, ButtonRelease, KeyPress, KeyRelease, and Motion. |
%Y | -rooty pixel | The y_root field. Relative to the (virtual) root window. Events: ButtonPress, ButtonRelease, KeyPress, KeyRelease, and Motion. |
18.191.168.83