Nope, ontext only seems to be called when you click outside the view (maybe it's the same as onblur?).
On Jan 5, 2006, at 8:27 PM, Henry Minsky wrote: I seem to remember some issue about needing to wait a frame for something like that. I see this code sitting in LzInput6, which defines the LzInputText class: //----------------------------------------------------------------------------- // Register to be called when the text field is modified. Convert this // into a LFC ontext event. // @keywords private //----------------------------------------------------------------------------- TextField.prototype.__onChanged = function ( ){ //this.__lzview.setText(this.text); this.__lzview.ontext.sendEvent( ); }
Maybe you can register for the ontext event?
On 1/5/06, Oliver Steele <[EMAIL PROTECTED]> wrote: How can I get the content of a text field as soon as a key is pressed?
If I do something like the following: <canvas> <edittext> <method event="onkeydown">Debug.write ('keydown', this.getText ())</method> </edittext> </canvas> then what is printed in the debugger omits the effect of the current key --- when I press 'a', the text field shows 'a' and the empty string is printed; then when I press 'b', the text field shows 'ab' and 'a' is printed. And the same with event="onkeyup".
Is there an elegant solution for this, or does one need to do something gnarly such as set a timer when a key is pressed in order to read the content on the next frame? _______________________________________________ Laszlo-user mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-user
-- Henry Minsky Software Architect [EMAIL PROTECTED]
|
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user