Your text widget needs focus to receive key events. Configure -takefocus => 1 or give it focus calling $text->focus().
Cheers, Christophuse warnings; use strict; use Tk; my $t=tkinit->Text(-state => 'disabled', -takefocus =>1, # tab-key moves focus )->pack; $t->bind('<Any-Key>'=>sub { print "received Key\n"; }); $t->focus; #init focus MainLoop;
In reply to Re: Tk Text widget & key bindings
by lamprecht
in thread Tk Text widget & key bindings
by brian42miller
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |