Re: Tab pressing



On Tue, 2005-12-13 at 10:44 -0600, Bob Caryl wrote:
> First you must intercept the <Enter> keystroke event before it is
> propagated to the widgets contained in your application window(s).  To
> do this, you must connect your own callback slot to
> Gtk::Main::signal_key_snooper like this:
> 
> Gtk::Main::signal_key_snooper().connect(sigc::mem_fun(*this,&YourClass::on_enter_key_pressed));

this is a dreadful idea. there is absolutely no reason to use the key
snooper for this. the class on_key_press_event() virtual method will
override and and all default key processing, and anything you want to do
from a key snooper there with regards to Tab/Enter can be done there.

key snooping is for a much more low level purpose, like watching all key
press/release events in all top level windows of an app. i use it, but
for this purpose its overkill.

--p




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