Re: Key presses
- From: Paul Davis <pbd Op Net>
- To: Andrei Zmievski <andrei ispi net>
- Cc: Jean-Christophe Berthon <jean-christophe berthon cgey com>, Bach Ngo <bachn LESTERELECTRICAL com>, gtk-list gnome org
- Subject: Re: Key presses
- Date: Tue, 31 Jul 2001 11:20:35 -0400
In message <20010731095219 Q15368 ispi net>you write:
>On Tue, 31 Jul 2001, Jean-Christophe Berthon wrote:
>> Maybe try to use the key_press event on the gtk widget that is involved.
>> something like :
>> gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
>> GTK_SIGNAL_FUNC (on_window_key_press_event),
>> NULL);
>> where on_window_key_press is a function with this prototype :
>> gboolean
>> on_window_key_press_event (GtkWidget *widget,
>> GdkEventKey *event,
>> gpointer user_data);
>>
>
>Right, that will do it for a specific widget. Is there a way to achieve
>the same thing for an entire app, independent of which widget has the
>focus?
1) no, the above is not *widget* specific. its window specific, since
"window" in the above code is a top-level GtkWindow, not widget->window.
2) if you really need it across the entire app, you can install a
key snooper. search the archives from about 2 months ago for a post
on doing this in GTK+.
--p
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]