Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Conditional check on Tk bind?

by mawe (Hermit)
on Aug 09, 2004 at 21:38 UTC ( [id://381363]=note: print w/replies, xml ) Need Help??


in reply to Conditional check on Tk bind?

Hi!

I would do it like this:
use Tk; my $top = MainWindow->new(); $top->bind("<KeyPress>" => [\&click,Ev('K')]); sub click { my ($window, $button) = @_; if ($button eq 'Control_L') { # ignore left Ctrl print "I don't do anything"; } else { print $button; } } MainLoop();

Hope this helps.
mawe

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://381363]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2024-04-23 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found