XUL Programmer's Reference Manual | ||||||||||||||||||||||||
<key>
|
||||||||||||||||||||||||
<key> is a XUL key binding widget. Key bindings define a relationship between between keystroke combinations and functionality in the interface. Keys are typically grouped into keysets.
|
||||||||||||||||||||||||
key | ||||||||||||||||||||||||
Description
key is an attribute required to specify the primary key of the binding for an event handler.Syntax <key id="string" key="keyboard character" />
<keyset>Notes The value of key is case-insensitive, so "S" means the same thing as "s". When there is no modifier specified, the primary key works by itself to prompt the event handler. When a modifier and a key are specified, then both need to be pressed to prompt the event hander.
|
||||||||||||||||||||||||
keycode | ||||||||||||||||||||||||
Description
keybode is an optional attribute for specifying keyboard command keys to prompt event handlers.Syntax <key id="string" keycode="keyboard character" />Example <key id="saveKey" key="s" keycode="VK_HOME" onkeydown="HomePage()" />Notes Common keycodes appear in the following table: |
||||||||||||||||||||||||
command | ||||||||||||||||||||||||
Description
command is an optional attribute for specifying command keys to be used in conjunction with the primary key to prompt event handlers.Syntax <key id="string" key="keyboard character" command="[ true | false]" />Example <key id="saveKey" key="s" command="true" onkeydown="Save()" />Notes The example above defines a key binding for the command + s key combination. The command keys vary from platform to platform, as shown in the following table: |
||||||||||||||||||||||||
alt | ||||||||||||||||||||||||
Description
alt is an optional attribute for specifying command keys to be used in conjunction with the primary key to prompt event handlers.Syntax <key id="string" key="keyboard character" alt="[ true | false]" />Example <key id="saveKey" key="s" alt="true" onkeydown="Save()" />Notes The example above defines a key binding for the alt + s key combination. The alt keys vary from platform to platform, as shown in the following table: |
||||||||||||||||||||||||
shift | ||||||||||||||||||||||||
Description
shift is an optional attribute for specifying command keys to be used in conjunction with the primary key to prompt event handlers.Syntax <key id="string" key="keyboard character" shift="[ true | false]" />Example <key id="saveKey" key="s" shift="true" onkeydown="Save()" />Notes The example above defines a key binding for the shift + s key combination. The modifier keys vary from platform to platform, as shown in the following table: |
||||||||||||||||||||||||
control | ||||||||||||||||||||||||
Description
control is an optional attribute for specifying command keys to be used in conjunction with the primary key to prompt event handlers.Syntax <key id="string" key="keyboard character" control="[ true | false]" />Example <key id="saveKey" key="s" control="true" onkeydown="Save()" />Notes The example above defines a key binding for the control + s key combination. The modifier keys vary from platform to platform, as shown in the following table: |
||||||||||||||||||||||||
onkeydown | ||||||||||||||||||||||||
Description
onkeydown is an optional attribute for creating event handlers for key bindings.Syntax <key id="string" key="keyboard character" onkeydown="event handler code" />Example <key id="saveKey" key="S" onkeydown="Save()" />Notes The keydown event is fired when the user first depresses the key specified by the key attribute (and the modifiers). The keypress event is effecctively equivalent to the keydown and keyup events together.
|
||||||||||||||||||||||||
onkeyup | ||||||||||||||||||||||||
Description
onkeyup is an optional attribute for creating event handlers for key bindings.Syntax <key id="string" key="keyboard character" onkeyup="event handler code" />Example <key id="saveKey" key="S" onkeyup="Save()" />Notes The keyup event is fired when the user releases the key specified by the key attribute (and the modifiers). The keypress event is effecctively equivalent to the keydown and keyup events together.
|
||||||||||||||||||||||||
onkeypress | ||||||||||||||||||||||||
Description
onkeypress is an optional attribute for creating event handlers for key bindings.Syntax <key id="string" key="keyboard character" onkeypress="event handler code" />Example <key id="saveKey" key="S" onkeypress="Save()" />Notes The keypress event is fired when the user presses the key specified by the key attribute (and the modifiers). The keypress event is effecctively equivalent to the keydown and keyup events together.
|
||||||||||||||||||||||||
oncommand | ||||||||||||||||||||||||
Description
oncommand is an optional attribute for creating event handlers for key bindings.Syntax <key id="string" key="keyboard character" oncommand="event handler code" />Example <key id="saveKey" key="S" oncommand="Save()" />Notes XXX. This still has to be updated. The keypress event is fired when the user presses the key specified by the key attribute (and the modifiers). The keypress event is effecctively equivalent to the keydown and keyup events together.
|
||||||||||||||||||||||||
Last updated: 4/12/00 Ian Oeschger