use SDL::App; use SDL::Rect; use SDL::Event; use SDL::Constants; use SDL::Tool::Font; my $app = SDL::App->new ( -width => 640, -height => 480, -depth => 16, ); my $rect = SDL::Rect->new ( -height => 100, -width => 100, -x => 270, -y => 390, ); my $f = SDL::Tool::Font->new( -ttfont=>"Courier", ); my %actions = ( SDL_QUIT() => sub { exit(0); }, SDL_KEYDOWN() => sub { $f->print ($rect, 0, 0, "Key Pressed"); }, ); $app->loop(\%actions);