Re: Key accelerators...



On Fri, 2009-05-22 at 15:55 +0200, Sever P A wrote: 
> Thanks a lot for your response, José.
> 
> Maybe, you are reason but,... I don't reach to understand all things.
> For example, how introduce and control an specific key (i.e.: F12)...
> 
> The exact situation is a Gtk toplevel Window which contains an Entry
> default focus widget. The idea is capture different function keys in
> order to switch data on the screen, even when writing in Entry box.

Once you enable your widget to catch keyboard events with
Gtk::Widget::add_events() and you have connected your widget to the
Gtk::Widget::signal_key_press_event().  Your handler can see which key
has been pressed by using the GdkEventKey[1] structure in your handler.

[1]
http://library.gnome.org/devel/gdk/2.12/gdk-Event-Structures.html#GdkEventKey

Remember, your handler should return false if you want the rest of your
widgets to react the the key presses also (see
http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/sec-xeventsignals.html). 

-- 
José Alburquerque



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