Binding User Interface

[previous] [next] [table of contents] [index]

A number of keystroke bindings, already defined by exmh, invoke different Tcl commands. You can change the bindings and add bindings for new commands via the Bind dialog. Open the dialog from the Commands menu entry under the Bindings menu. The dialog presents two columns of commands and their bindings, plus an area at the top to define a new binding.

Binding Syntax. Here is a brief summary of the Tk bind syntax. To get the complete story, consult the Tk manual page for the bind command. The Tk syntax for the bindings events is:

<modifier-type-detail>

In that syntax,

Perhaps the easiest way to figure out the keysym is to use the following Tcl/Tk command. Run the Tcl/Tk shell, wish, and enter the command shown in the next Example. A little window will open. Type characters into that window, and you'll see keysym information underneath the wish command line.

In the example below, after starting wish and typing the bind command, I moved the mouse to the little window. I pressed and held down the left <Shift> key, pressed the <g> key and the <dollar> key, released the <Shift> key, and pressed the <q> key. I moved the mouse back to the shell window and typed <Control-d> to quit wish.

Example: Finding an X keysym

unix$ wish
% bind . <Any-Key> {puts stdout "keysym = %K letter = %A"}
% keysym = Shift_L letter = 
keysym = G letter = G
keysym = dollar letter = $
keysym = q letter = q
CTRL-D
unix$

[Table of Contents] [Index] [Previous: Preference Sections] [Next: MH Profile]


This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.


Questions or problems regarding this web site should be directed to Steve Gielda.
Copyright 1999 www.cotse.com.  All rights reserved.
Last modified: Friday April 02, 1999.