From: teeshift Date: 2007-01-17T10:35:09+09:00 Subject: Re: keystrokes detection for non-control, meta key Thank you Joel. 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{}) what should be inside the 'proc'? I know e.x, e.y but have tried e.keys, e.key, e.value without success and did not find any valuable information on Event. Thank you. Tee Joel VanderWerf wrote: > teeshift wrote: > > I have tried > > > > @canvas.bind('k', proc{|e| }) > > @canvas.bind('KeyPress-k', proc{|e| }) > > @canvas.bind('Key-k', proc{|e| }) > > > > well... none of them work. > > Try > root.bind("Key-k") {...} > > IIRC, the reason is that key events are sent to the top level window > unless you have focused on a subwindow. > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407