use strict; use warnings; use Tk; my $mw = MainWindow->new (-title => "PerlMonks node editor"); my $text = $mw->Scrolled ('Text', -font => 'normal', -wrap => 'word', -scrollbars => 'e',); $text->pack (-expand => 'yes', -fill => 'both'); $text->bindtags ([$text, ref($text), $text->toplevel, 'all']); $text->bind ('', [\&keyCommand, 'italic']); MainLoop (); sub keyCommand { print "Got Control i\n"; Tk->break; }