- From: Philippe Le Hegaret <plh@w3.org>
- Date: 24 Jul 2003 10:24:07 -0400
- To: Brad Pettit <bradp@microsoft.com>
- Cc: WWW DOM <www-dom@w3.org>
> In previous mailing list discussion, it's been clarified that > "canceling" a keyDown event has NO EFFECT on whether a textEvent event > is generated from that keyDown. This should be in the spec. In what > case would visibleOutputGenerated be TRUE for any TextEvent other than > textInput? Brad, we revisited recently this issue. You may have noticed that the Last Call version of DOM Events contains the following issue (Issue keyboard-1): [[ Should the cancellation of a keydown prevent the textInput/keyup event types from being dispatched? ]] IE, Mozilla, and Opera implementations don't generate a keypress if the keydown is cancelled. keyup is still generated. Cancelling keyup has the same effect as cancelling keydown. The following section was added in the appendix on keyboard events: [[ A.1.4 Default actions and cancelable keyboard events Canceling the default action of a keydown/keyup event does not affect its respective keyup/keydown event; it will however prevent the respective textInput event from being generated. The following example describes a possible sequence of keys to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping: 1. {"http://www.w3.org/2001/xml-events", "keydown"}: "U+0051" (Latin Capital Letter Q key), shiftKey the default action of the keydown event is prevented. 2. No {"http://www.w3.org/2001/xml-events", "textInput"} is generated. 3. {"http://www.w3.org/2001/xml-events", "keyup"}: "U+0051", shiftKey If the key is a modifier key, the keystroke is taken into account for the modifiers states. The following example describes a possible sequence of keys to generate the Unicode character Q (Latin Capital Letter Q) on a PC/AT US keyboard using a US mapping: 1. {"http://www.w3.org/2001/xml-events", "keydown"}: "Shift", shiftKey the default action of the keydown event is prevented. 2. {"http://www.w3.org/2001/xml-events", "keydown"}: "U+0051" (Latin Capital Letter Q key), shiftKey 3. {"http://www.w3.org/2001/xml-events", "textInput"}: "Q" 4. {"http://www.w3.org/2001/xml-events", "keyup"}: "U+0051", shiftKey 5. {"http://www.w3.org/2001/xml-events", "keyup"}: "Shift" If the key is part of a sequence of several keystrokes, whether it is a dead key or it is contributing to an Input Method Editor sequence, the keystroke is not taken into account only if the default action is canceled on the keydown event. Canceling a dead key on a keyup event as not effect on textInput events. The following example uses the keystrokes "U+0302" (Combining Circumflex Accent key) and "U+0045" (Latin Capital Letter E key) (on a PC/AT french keyboard using a french mapping and without any modifier activated): 1. {"http://www.w3.org/2001/xml-events", "keydown"}: "U+0302" (Combining Circumflex Accent key) the default action of the keydown event is prevented. 2. {"http://www.w3.org/2001/xml-events", "keyup"}: "U+0302" 3. {"http://www.w3.org/2001/xml-events", "keydown"}: "U+0045" (Latin Capital Letter E key) 4. {"http://www.w3.org/2001/xml-events", "textInput"}: "a" 5. {"http://www.w3.org/2001/xml-events", "keyup"}: "U+0045" If the key is part of a sequence of several keystrokes contributing to an Input Method Editor sequence, the keystroke is not taken into account. ]] Following this addition, we closed issue keyboard-1. Let us know if you are satisfy or not, Philippe
Received on Thursday, 24 July 2003 10:24:11 UTC