#!/usr/bin/perl use strict; use warnings; use Tk; my ($width,$height) = (300,400); my $mw = tkinit; $mw->geometry( $width . 'x' . $height ); $mw->bind('', \&focus_in); MainLoop; sub focus_in{ print "aktiviert\n"; }