summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Tk/demos/widget_lib/keysyms.pl
blob: 17f594d70614fab273156d7beaeafac200ca10eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use strict;

sub keysyms {

    my( $demo ) = @_;

    my $mw = $MW->WidgetDemo(
        -name             => $demo,
        -text             => 'This demonstration displays the keysym for any keyboard character.',
        -title            => 'Display Keysyms',
        -iconname         => 'keysyms',
    );

    $mw->Label( qw/ -relief solid -width 20 /, -textvariable => \my $k )->pack;

    $mw->bind( '<KeyPress>' => sub {
        $k = sprintf( "%s", $Tk::event->K );
    });

} # end keysyms