From: Joel VanderWerf Date: 2007-01-17T16:23:05+09:00 Subject: Re: keystrokes detection for non-control, meta key teeshift wrote: > Thank you Joel. You're welcome! > I tried and it worked. Now, is there a way to find which key users have > pressed without > specifying it first? > > @canvas.bind('Key', proc{}) I was curious about this too. To find out, add something like this: root.bind "Key" do |stuff| p stuff, stuff.methods end Then press a key in your window. It turns out that the "stuff" is an Event instance, and it has @keysym="h", and there are #keycode and #keysym methods. If you add the line p stuff.keycode, stuff.keysym then you can see that pressing the "h" key gives this output: 43 "h" So probably the #keysym method is what you want. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407