Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 47173
Status: stalled
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: Legends.9.OkianWarrior [...] SPamGourmet.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 804.028
Fixed in: (no value)



Subject: "Modifier" key releases don't track key presses correctly
Using Ali Corbin's quick-and-dirty program to print out key presses *and releases* (below) shows the following: Pressing Control_R results in: Control_R pressed Control_L released <--- should be Control_R Pressing Control_L results in: Control_L pressed Control_L released <--- correct The same problem happens with Alt and Shift; ie - the "press" of Alt_R is correct, but the *release* reports Alt_L. This makes it fairly difficult for a program to keep track of key modifiers. Using strawberry perl on WinXP with Service pack 2. Tk version 804.028 01fvhx ################################################################# # # (Program modified to include key release as well as press) # #!/usr/local/bin/perl -w use Tk; $top = MainWindow->new(); $frame = $top->Frame( -height => '6c', -width => '6c', -background => 'black', -cursor => 'gobbler' ); $frame->pack; $top->bind( '<Any-KeyPress>' => sub { my($c) = @_; my $e = $c->XEvent; my( $x, $y, $W, $K, $A ) = ( $e->x, $e->y, $e->K, $e->W, $e->A ); print "A key was pressed:\n"; print " x = $x\n"; print " y = $y\n"; print " W = $K\n"; print " K = $W\n"; print " A = $A\n"; } ); $top->bind( '<Any-KeyRelease>' => sub { my($c) = @_; my $e = $c->XEvent; my( $x, $y, $W, $K, $A ) = ( $e->x, $e->y, $e->K, $e->W, $e->A ); print "A key was released:\n"; print " x = $x\n"; print " y = $y\n"; print " W = $K\n"; print " K = $W\n"; print " A = $A\n"; } ); MainLoop();
Subject: Test.pl
#!/usr/local/bin/perl -w use Tk; $top = MainWindow->new(); $frame = $top->Frame( -height => '6c', -width => '6c', -background => 'black', -cursor => 'gobbler' ); $frame->pack; $top->bind( '<Any-KeyPress>' => sub { my($c) = @_; my $e = $c->XEvent; my( $x, $y, $W, $K, $A ) = ( $e->x, $e->y, $e->K, $e->W, $e->A ); print "A key was pressed:\n"; print " x = $x\n"; print " y = $y\n"; print " W = $K\n"; print " K = $W\n"; print " A = $A\n"; } ); $top->bind( '<Any-KeyRelease>' => sub { my($c) = @_; my $e = $c->XEvent; my( $x, $y, $W, $K, $A ) = ( $e->x, $e->y, $e->K, $e->W, $e->A ); print "A key was released:\n"; print " x = $x\n"; print " y = $y\n"; print " W = $K\n"; print " K = $W\n"; print " A = $A\n"; } ); MainLoop();
On Sat Jun 20 01:33:28 2009, Bitcard111 wrote: Show quoted text
> Using Ali Corbin's quick-and-dirty program to print out key presses *and > releases* (below) shows the following: > > Pressing Control_R results in: > Control_R pressed > Control_L released <--- should be Control_R > > Pressing Control_L results in: > Control_L pressed > Control_L released <--- correct > > The same problem happens with Alt and Shift; ie - the "press" of Alt_R > is correct, but the *release* reports Alt_L. > > This makes it fairly difficult for a program to keep track of key
modifiers. Show quoted text
> > Using strawberry perl on WinXP with Service pack 2. Tk version 804.028 > 01fvhx >
Just for the record: the behavior seems to be correct under FreeBSD (Control_R -> Control_R), so probably a Windows-only problem. Regards, Slaven
On Fri Oct 16 15:39:35 2009, SREZIC wrote: Show quoted text
> On Sat Jun 20 01:33:28 2009, Bitcard111 wrote:
> > Using Ali Corbin's quick-and-dirty program to print out key presses *and > > releases* (below) shows the following: > > > > Pressing Control_R results in: > > Control_R pressed > > Control_L released <--- should be Control_R > > > > Pressing Control_L results in: > > Control_L pressed > > Control_L released <--- correct > > > > The same problem happens with Alt and Shift; ie - the "press" of Alt_R > > is correct, but the *release* reports Alt_L. > > > > This makes it fairly difficult for a program to keep track of key
> modifiers.
> > > > Using strawberry perl on WinXP with Service pack 2. Tk version 804.028 > > 01fvhx > >
> > Just for the record: the behavior seems to be correct under FreeBSD > (Control_R -> Control_R), so probably a Windows-only problem. >
The original Tcl/Tk also has the same problem, so I filed a bug report there: https://sourceforge.net/tracker/index.php?func=detail&aid=2945130&group_id=12997&atid=112997 Once it is fixed there I can apply the fix also to the Perl/Tk version. Regards, Slaven