use Tk; $top = MainWindow->new(); $frame = $top->Frame( -height => '6c', -width => '6c', -background => 'black', -cursor => 'gobbler' ); $frame->pack; $top->bind( '' => 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"; } ); MainLoop();