 <p>Perl/Tk does not provide such functionality. So you would have to track the events yourself. Note that there are the <code>Any-KeyPress</code> and <code>Any-KeyRelease</code> events, so you don't have to create a binding for every key:</p> <pre><code>$mw-&gt;bind("&lt;Any-KeyPress&gt;" =&gt; sub { warn $_[0]-&gt;XEvent-&gt;K; # prints keysym }); </code></pre> <p>If you're on X11, then using the <code>X11::Protocol</code> module (which can be used within a Perl/Tk script) and calling the <code>QueryKeymap</code> method would give you the actually pressed keycodes. Here's a little script which demonstrates this:</p> <pre><code>use strict; use X11::Protocol; # Get the keycode-to-keysym mapping. Being lazy, I just parse # the output of xmodmap -pke. The "real" approach would be to # use X11 functions like GetKeyboardMapping() and the # X11::Keysyms module. my %keycode_to_keysym; { open my $fh, "-|", "xmodmap", "-pke" or die $!; while(&lt;$fh&gt;) { chomp; if (m{^keycode\s+(\d+)\s*=(?:\s*(\S+))?}) { if (defined $2) { $keycode_to_keysym{$1} = $2; } } else { warn "Cannot parse $_"; } } } my $x11 = X11::Protocol-&gt;new; while(1) { my $keyvec = $x11-&gt;QueryKeymap; for my $bit (0 .. 32*8-1) { if (vec $keyvec, $bit, 1) { warn "Active key: keycode $bit, keysym $keycode_to_keysym{$bit}\n"; } } sleep 1; } </code></pre>