Version 2 of Key-press names

Updated 2002-05-21 10:53:25

Frequently people ask 'what is the value I give to bind for the KKK key' (where KKK is replaced by things like space, tab, etc.)

Here's a line of Tk which will display the names that bind accepts; just press the key and it writes (to stdout) the phrase. Of course, on MacOS or Windows you have to ensure you have a console for the stdout to be displayed. [Do we have a wiki reference for how to ensure this?]

bind . <Key> {puts "You pressed the key called \"%K\""}