lz.Keys is the single instance of the class
lz.KeysService.
Here is a simple example:
Example 16. lz.Keys
<canvas height="250" debug="true">
<debug height="90%"/>
<handler name="onkeydown" reference="lz.Keys" args="k">
Debug.debug("key %w %s", k, "down");
</handler>
<handler name="onkeyup" reference="lz.Keys" args="k">
Debug.debug("key %w %s", k, "up");
</handler>
<method name="pressA" args="ignore=null">
Debug.debug("A pressed");
</method>
<handler name="oninit">
var del = new LzDelegate(this, "pressA");
lz.Keys.callOnKeyCombo(del, ["A"]);
</handler>
</canvas>
| Name (CSS property) | Type (tag) | Type (js) | Default | Category |
|---|---|---|---|---|
mousewheeldelta
|
Number | Number | 0 | readonly |
| The amount the mouse wheel last moved. Use the onmousewheeldelta event to learn when this value changes. | ||||
| Name (CSS property) | Type (tag) | Type (js) | Default | Category |
|---|---|---|---|---|
LzKeys
|
lz.KeysService | readonly | ||
The key service. Also available as the global
lz.Keys.
|
||||
Methods
| callOnKeyCombo() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| d | lz.handler | The delegate to be called when the keycombo is down. |
| kCArr | Array | Array of strings indicating which keys constitute the keycombo. This array may be in any order. |
| isKeyDown() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| k | The name of the key to check for downness or an array of key names, e.g. ['shift', 'tab'] |
| removeKeyComboCall() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| d | lz.handler | The delegate that was to be called when the keycombo was down. |
| kCArr | Array | An array of strings indicating which keys constituted the keycombo. |
| setGlobalFocusTrap() |
|---|
Events
Copyright © 2002-2010 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.