is there any way for generally change the tab key into enter key to move
the focus around all widgets in a application ?
Thanks
Pit
Hmm, perhaps this..
$mw->bind('<Return>' => sub {
$mw->focusNext;
$mw->update;
});
There might be problems with the Text widget, which
may present a glitch see: http://perlmonks.org?node_id=403801
And look at this, where the text grabs the tab, and prevents
a focus shift. Uncomment the -takefocus line to fix it.
Other widgets may do something like this too.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $mw = MainWindow->new(-title=>'Text');
$mw->bind("<Key>", [ sub { print "Key: $_[1] \n" } , Ev('K') ] );
my $text = $mw->Text(
# -takefocus =>0
)->pack;
for(1..3){
$mw->Button(-text=> $_)->pack();
}
MainLoop;
__END__
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html