[Gtk-sharp-list] catch Key.Press.Event

Bjoern Schiessle bes@schiessle.org
Thu, 11 Nov 2004 13:56:42 +0100


Hello,
i have a program with a Gtk.SpinButton and want to catch the
'Return'-key to emit a Gtk.Button.Click() signal.
With glade i have connect the "key_press_event" signal with the
"on_Spinbutton_key_press_event" function.
This is the function:

void on_Spinbutton_key_press_event(object obj,
                                   KeyPressEventArgs args)
    {
        if (args.Event.Key == Gdk.Key.Return)
            CalculateButton.Click();
    } 

I have insert a Console.WriteLine to check on which key-press the
function gets called. And it seems that the function gets called by
pressing the function-keys(F1, F2,..), esc, scroll, print,
pause,... but not if i press a letter, number or the Return key.

How can i catch the Return-key in a Gtk.SpinButton?

Cheers,
Bjoern

-- 
 ,= ,-_-. =.  Bjoern Schiessle
((_/)o o(\_)) http://www.schiessle.org
 `-'(. .)`-'  If art interprets our dreams, the computer
     \_/      execute them in the guise of programs!