http://www.purl.org/tcl/home/man/tcl8.4/TkCmd/keysyms.htm describes what key symbol values can be used with bind (any other commands?). ---- [[What is a key symbol?]] ---- Open a wish session and type bind . {puts %K} Then press any key or key combination to learn the keysym for your desired key binding ---- Is there any way to use accented characters (as used in many European languages) in bindings? I want, for example, Alt-e' (meant to be Alt pressed with an accented e) to be bound to a command. -- [CLN] 2001-06-11 [Peter Lewerin] 2001-06-30: bind . ... would seem to do what you want, but possibly only if you actually have a � key to press. At least for me, characters composed with dead keys don't fire the bindings, but character keys (e.g. adiaeresis on my keyboard) do. ---- [[Distinguish keysyms and key codes.]] ---- [Mo] included in the Tk test suite keypress-pertinent code. He advises, "See the following procs in tk/tests/event.test: _init_keypress_lookup _keypress_lookup _keypress _keypress_string With these commands you can do the following: _keypress_string $w HELLO\n This will generate a keypress for each letter followed by an event for the return key." ---- ''jfron'' wrote in [the comp.lang.tcl newsgroup]: proc tryGetChar {k} { set c [string index [.t get 1.0 end] 0] set ::kmap($c) $k set ::revmap($k) $c .t delete 1.0 end } text .t # pack .t bind .t {tryGetChar %k} for {set i 0} {$i<$256} {incr i} { focus -force .t event generate .t -keycode $i } destroy .t Viola! now just [[array get ::kmap $char]] to find the keycode for a char. Simple, dirty, and able to regenerate itself inline no matter what platform you've got. If it gets caught by the text widget's default bindings and doesn't display anything, well, I probably don't want to know about it anyhow. There's got to be an easier way. Is there really no standard mapping of keycodes? [Tk syntax help] - [Arts and crafts of Tcl-Tk programming]