[Gtk-sharp-list] Getting Keyboard Input

Charles Iliya Krempeaux charles@reptile.ca
11 Apr 2003 08:46:31 -0700


Hello,

On Fri, 2003-04-11 at 01:50, Lee Mallabone wrote:

[...]

> The Widget has a whole bunch of event handlers, key press is one of them - can't remember how you hook into the Gdk.Window events manually.

I took a look around, and found I could do a...

    Gtk.Widget w = // Something that is a descendent of Gtk.Widget
                   // or Gtk.Widget itself.

    w.KeyPressEvent +=
        new GtkSharp.KeyPressEventHandler(MyKeyPressedEventHandler);

Where MyKeyPressedEventHandler is a method I define with a signature
like:

void MyKeyPressedEventHandler(object o, GtkSharp.KeyPressEventArgs args)

or:

static
void MyKeyPressedEventHandler(object o, GtkSharp.KeyPressEventArgs args)


(Thanks for pointing me in the right direction.)

See ya

-- 
     Charles Iliya Krempeaux, BSc
     charles@reptile.ca

________________________________________________________________________
 Reptile Consulting & Services    604-REPTILE    http://www.reptile.ca/