Gtk-Perl $event->{keyval}



Greetings!

I've been wondering how one determines in a system-independent way what
keyval corresponds to what key in the Perl Gtk bindings.  Currently, I'm
using something like this (which is really ugly for several reasons):

sub key_press_event {
    my ($clist, $self, $event) = @_;
    if ($event->{keyval} == 65535) { #FIXME
	$self->set_flag($self->{messageList}->[$clist->selection]->{uid},
			'\Deleted');
    }
    #...
}

The first reason this is ugly is that the keyval is hardcoded.	On my
system, 65535 corresponds to my delete (not backspace) key.  That doesn't
seem like it would be general to all systems; does the perl binding have an
abstraction for this?  I didn't see one in my (admittedly casual) perusal.

Of course, this is also ugly in regards to how I correlate rows in the
CList to the data I want to associate with them, but I digress.

Thanks in advance!
James



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