Re: Tab pressing
- From: "R. Douglas Barbieri" <dooglio gmail com>
- To: bob fis-cal com
- Cc: gtkmm-list gnome org
- Subject: Re: Tab pressing
- Date: Tue, 13 Dec 2005 10:32:22 -0800
You can also assign a keypress signal to any widget: signal_key_press_event().
On 12/13/05, Bob Caryl <bob fis-cal com> 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 callback slot will receive a Gtk::Widget pointer and a GdkEventKey
> pointer; so you can determine whether or not the enter key has been
> pressed. I attempted to use gtk_propagate_event to propagate a TAB
> keypress, but I was unable to get it to work. The code below definitely
> intercepts the <Enter> keystroke.
>
> // code begins
> YourClass::on_enter_key_pressed(Gtk::Widget* widget, GdkEventKey *keyevent)
> {
>
> if(keyevent->keyval == GDK_Enter && keyevent->type == GDK_KEY_PRESS)
> {
>
> }
>
> return 1;
>
> }
> // code ends
>
> Disclaimer: I could not find anything on what the return value from the
> callback should be or why.
>
> Can anyone help with code to propagate a tab key press for Volosatov?
>
> Bob
>
> Volosatov Alexander wrote:
>
> >I need when user press <Enter>, emit <Tab> pressing.
> >What function I must use and how?
> >
> >Alex
> >_______________________________________________
> >gtkmm-list mailing list
> >gtkmm-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> >
> >
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
--
R. Douglas Barbieri
doug dooglio net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]