On Fri, 2007-11-16 at 17:56 +0100, Gaetan de Menten wrote: > Hi people, > > Does anybody know if there is an easy way to implement a default > widget with Qooxdoo. I mean a widget (usually a button) which catch > "enter" events in other fields. > This is meant to speed up some forms, for example login forms: you > enter your login, password and then immediately press enter (without > first focusing the "sign in" button first), and this actually > activates said button. I know such a mechanism exist in GTK/Glade (and > probably other GUI toolkits too). > > Is there a mechanism I could use in Qooxdoo to do this easily or do I > have to manually configure event listeners on each of my fields? >
/* Option 1 */ var f = function(e) { if (e.getKeyCode() == qx.event.type.KeyEvent.keys.enter) { alert("enter pressed"); } }; qx.ui.core.ClientDocument.getInstance().addEventListener("keydown", f, this); /* Option 2 */ var c = new qx.client.Command("Enter"); c.addEventListener("execute",function(e) { alert("enter pressed"); },this); -- --------------------------- Raúl Gutierrez S. Investigación y Desarrollo Taller de Ideas S.A. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel