Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing Tab-Key for moving focus

8 views
Skip to first unread message

Pit

unread,
Feb 16, 2007, 4:40:58 AM2/16/07
to
Hi All,

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

Q...@domain.invalid.com

unread,
Feb 16, 2007, 2:42:34 PM2/16/07
to

"Pit" <pharr...@am-soft.de> wrote in message-id:
<7ed4f40b0f749fb3...@localhost.talkaboutprogramming.com>

Hmm, perhaps this..

$mw->bind('<Return>' => sub {
$mw->focusNext;
$mw->update;
});


zentara

unread,
Feb 17, 2007, 7:29:47 AM2/17/07
to

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

0 new messages