[Gtk-sharp-list] KeyPressEvent not responding to space/enter/up/down/left/right

Ben Motmans ben.motmans at gmail.com
Thu Jul 28 05:59:48 EDT 2005


On 7/28/05, Mike Voytovich <mikevoyt at gmail.com> wrote:
> ...
>         static void keypress_event(object obj, KeyPressEventArgs args)
>         {
>                         System.Console.WriteLine("Keypress: {0}", args.Event.Key);
>         }
> ...

you need to add the [GLib.ConnectBefore ()] attribute to the method
that receives the event, to make sure the method is invoked before the
default signal handler

in other words:
[GLib.ConnectBefore ()]
static void keypress_event (....)

-- Ben


More information about the Gtk-sharp-list mailing list