in reply to Tk bind key hexadecimal value
use strict; use Tk; my $mw = MainWindow->new; $mw->bind('<KeyPress>' => \&print_keysym); $mw->Button( -text => 'Exit', -command => sub { exit(); } )->pack; MainLoop; sub print_keysym { my $widget = shift; my $e = $widget->XEvent; my ($keysym_text, $keysym_decimal) = ($e->K, $e->N); print "keysym=$keysym_text, numberic=$keysym_decimal\n"; }
See it Keyboard input with Perl/Tk's -bind()
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk bind key hexadecimal value
by Anonymous Monk on Apr 20, 2018 at 16:21 UTC | |
by Anonymous Monk on Apr 20, 2018 at 16:27 UTC |