Name
command (LzCommand) — An element that sends events in response to keyboard input.
Description
Sample applications that use the command
tag:
Also, see
LzKeys.
Details
Properties (2)
-
active
-
<attribute name="active" type="boolean" />
public var active : Boolean = true;
true if the command is currently active.
The default is
true.
-
keys
-
<attribute name="keys" type="[String]" />
public var keys : [String];
array of keys (strings) that, when pressed together,
cause the onselect event of the command to be sent. For example:
setAttribute('key', ['a', 'shift']) or setKeys(['j', 'control'])
Setters (1)
Setters for virtual properties, to be used with setAttribute. A setter may or may not have a corresponding getter method;
consult the Methods list in this section.
-
key
Methods (3)
-
execute()
-
<method name="execute" args="d" />
public function execute(d : any);
Sends the command's onselect event.
-
keysToString()
-
<method name="keysToString" />
public function keysToString() : String;
This is a utility method that returns a string that describes the key
combination that causes this command to be invoked.
-
setKeys()
-
<method name="setKeys" args="k" />
public function setKeys(k);
This registers the given key array so that the command is executed when the
key array is pressed.
Events (1)
-
onselect
-
<attribute name="onselect" />
If the command is active, this event is sent
when the keys array are pressed simultaneously.
LZX Synopsis
<class name="
LzCommand" extends="
LzNode
">
<attribute name="
active
" type="
boolean" />
<attribute name="
keys
" type="
[String]" />
<method name="
execute
" args="
d" />
<method name="
setKeys
" args="
k" />
</class>
JavaScript Synopsis
public
LzCommand extends
LzNode
{
public var
active
:
Boolean = true;
public var
keys
:
[String];
prototype public function
execute
(
d : any);
prototype public function
setKeys
(
k);
}