[Gtk-sharp-list] catching enter key in Gtk.Entry

Miguel de Icaza miguel@ximian.com
12 Apr 2003 14:38:56 -0400


Hello,

> Is there an event to catch the enterkey ?

Although you can catch the actual event for the enter key being pressed,
you probably want to use a signal provided for this particular use
called "Activated".

	Gtk.Entry entry = new Gtk.Entry ();
	entry.Activated += new EventHandler (EnterPressed);

	...

	void EnterPressed (object sender, EventArgs args)
	{
		Console.WriteLine ("Entry has been activated");
	}

Activated might also be triggered by the accessibility features through
a voice command.

Miguel.