Re: catching ESC key
- From: muppet <scott asofyet org>
- To: Gábor Szabó <szabgab gmail com>
- Cc: GTK2-Perl List <gtk-perl-list gnome org>
- Subject: Re: catching ESC key
- Date: Sat, 30 Jul 2005 11:03:20 -0400
On Jul 30, 2005, at 3:18 AM, Gábor Szabó wrote:
I could not figure it out with accelerators.
How can I catch when the user presses ESC?
For that matter how can I catch any other special key?
In what context? If you want to use ESC to clear a modal dialog,
just make sure the dialog has a 'cancel' response, and
Gtk2::Dialog::run() will do the rest. (The gtk+ team and the HIG
folks have tried to work out when it makes sense to use ESC to clear
dialogs, and make the toolkit Do The Right Thing.)
For anything else, ESC is just like any other key. Connect to 'key-
press-event' and look for $event->keyval == $Gtk2::Gdk::Keysyms{Escape}.
--
Package contains eight 13-inch aliens in assorted colors.
-- Catalog copy for space invaders wall decals.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]