*** Gtk3::Gdk::keyval_name: passed too many parameters (expected 1, got 2); ignoring excess at keyval.pl line 22. Argument "Gtk3::Gdk" isn't numeric in subroutine entry at /usr/lib/x86_64-linux-gnu/perl5/5.26/Glib/Object/Introspection.pm line 67 (#1) #### #!/usr/bin/perl use strict; use diagnostics; use warnings; use Gtk3 '-init'; my $window = Gtk3::Window->new('toplevel'); $window->set_title('Hello world'); $window->set_position('center'); $window->set_default_size(500, 500); $window->signal_connect('delete-event' => sub { Gtk3->main_quit(); exit; }); $window->signal_connect('key-press-event' => sub { my ($widget, $event) = @_; print "keyval " . Gtk3::Gdk->keyval_name($event->keyval) . "\n"; }); $window->show_all(); Gtk3->main();