Re: key_press event


If I understend you correctly you might to try this

use Gtk::Keysyms;

if ($Gtk::Keysyms{'Return'} == $event->{keyval}) {

On Wed, 27 Mar 2002, [iso-8859-1] MickaКl Villers wrote:

Hello all,
I want to wrap the enter key on my Gtk::Entry,
I use this callback to do this and it works:

sub envoi_msg                                                       
      my $self = shift;                                           
      my (@event) = @_;                                           
      my $event = pop( @event );                                  
      if( (defined($event->{'type'})) and ( $event->{'type'} eq 'key_press'))      
              print   "test-".$event->{'keyval'}."-\n";                 

It show me the good key code, but I don't find how to have human
readable constant for the keycode, like GDK_KP_Enter!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]