in reply to Conditional check on Tk bind?
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();
|
|---|