should it be onkeypress or oncommand?

RESOLVED FIXED

Status

RESOLVED FIXED
11 years ago
6 years ago

People

(Reporter: sspitzer, Unassigned)

Tracking

Details

(URL)

(Reporter)

Description

11 years ago
should it be onkeypress or oncommand?

from http://developer.mozilla.org/en/docs/XUL_Tutorial:Keyboard_Shortcuts

The first way is the simplest and just requires that you use the keypress event handler on the key element. When the user presses the key, the script will be invoked. An example is shown below:

<keyset>
  <key id="copy-key" modifiers="accel" key="C" oncommand="DoCopy();"/>
</keyset>

notice the text says "keypress event" but the code says "oncommand"

should it be:  "the command event handler on the key element."

from the original http://www.xulplanet.com/tutorials/xultu/keyshort.html, we had:

<keyset>
  <key id="copy-key" modifiers="accel" key="C" onkeypress="DoCopy();"/>
</keyset>

Comment 1

11 years ago
It should be the command event.
(Reporter)

Comment 2

11 years ago
so:

"use the keypress event handler on the key element."

should be:

"use the command event handler on the key element."

fixed, thanks Neil!

(next time I won't log a bug for something like this.)
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
(Assignee)

Updated

6 years ago
Component: Documentation Requests → Documentation
Product: Mozilla Developer Network → Mozilla Developer Network
Component: Documentation → General
Product: Mozilla Developer Network → Developer Documentation
You need to log in before you can comment on or make changes to this bug.