Keystroke Handling

From Documentation
Revision as of 08:34, 21 December 2010 by Tomyeh (talk | contribs)


Keystroke Handling


Keystroke handling is generic. Any component inherited from XulElement can handle the key event in the same way.

ENTER and ESC

To handle ENTER, you could listen to the onOK event (notice O and K are both in upper case). To handle ESC, you could listen to the onCancel event. For example,

<grid id="form" apply="foo.Login">
    <rows>
        <row>Username: <textbox id="username"/></row>
        <row>Password: <textbox id="password" type="password"/></row>
        <row><button label="Login" forward="form.onOK"/><button label="Reset" forward="form.onCancel"/></row>
    </rows>
</grid>

Control Keys

Version History

Last Update : 2010/12/21


Version Date Content
     


Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.