An element that sends events in response to keyboard input.
<canvas height="130" debug="true">
<command onselect="Debug.write('the enter key was pressed');"
key="['Enter']" />
</canvas>
Sample applications that use the <command> tag:
| Attributes | |||||
| Name | Usage | Type (Tag) | Type (JS) | Default | Category |
| active | Tag & JS | boolean | Boolean | readonly | |
| true if the command is currently active. The default is true. | |||||
|
|
|||||
| key | Tag & JS | expression | Array of String | setter | |
| Use setAttribute or setKeys to set the group of keys associated with this command from JavaScript. For example: setAttribute('key', ['a', 'shift']) or setKeys(['j', 'control']) | |||||
|
|
|||||
| keys | JS only | Array of String | readonly | ||
| array of keys (strings) that, when pressed together, cause the onselect event of the command to be sent. | |||||
|
|
|||||
| onselect | Tag only | script | eventhandler | ||
|
|
|||||
class, classroot, cloneManager, datapath, defaultplacement, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes
| execute() | ||
| LzCommand.execute(d) | ||
|
Sends the command's onselect event. |
||
| Parameters | ||
| Name | Type | Desc |
| d | any | this optional parameter is passed to the onselect event |
|
|
||
| keysToString() | ||
| LzCommand.keysToString() | ||
|
This is a utility method that returns a string that describes the key combination that causes this command to be invoked. |
||
| Returns | ||
| Type | Desc | |
| String | A string containing the key combination that causes this command to be invoked. | |
|
|
||
| setKeys() | ||
| LzCommand.setKeys(k) | ||
|
This registers the given key array so that the command is executed when the key array is pressed. |
||
| Parameters | ||
| Name | Type | Desc |
| k | [String] | An array of keys, given as strings. |
|
|
||
animate, applyConstraint, applyData, childOf, completeInstantiation, construct, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, init, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption
| Events | |
| Name | Description |
| onselect | None |
Copyright © 2002-2005 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.