From 579c1787556d76de94a09ddf7cdbf403a77909e1 Mon Sep 17 00:00:00 2001
From: Simon Pieters See IDL definition in UI Events. The
+ If this's dispatch flag is set, then return.
+
+ Initialize a UIEvent with this, |type| and |eventTarget|
+
+ Set this.{{bubbles}} = |bubbles|
+
+ Set this.{{cancelable}} = |cancelable|
+
+ Set this.{{view}} = |view|
+
+ The bubbles/cancelable/view should be parameters to "Initialize a UIEvent" instead of being set twice.
+
+ Set this.{{TextEvent/data}} = |data|
+ To the extent possible under law, the editors have waived all copyright
and related or neighboring rights to this work.
-In addition, as of 19 October 2021,
+In addition, as of 8 February 2024,
the editors have made this specification available under the Open Web Foundation Agreement Version 1.0,
which is available at http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
Parts of this work may be from another specification document. If so, those parts are instead covered by the license of that specification document. This document attempts to describe, in an algorithmic manner, how UIEvents
-
- should be handled by User Agents. Because this functionality has been shipping
- in UAs for many years, the primary goal is to document the existing behaviors
- and identify areas where implementations disagree. The intent is to fold this
- information into the main UIEvents spec (and other specs) once there is
- consensus that this process described here is adequate.Text Event
+
+Note: {{TextEvent}} is obsolete.
+
+TextEvent Interface
+
+data
attribute must return the value it was initialized to.
+
+initTextEvent(type, bubbles, cancelable, view, data)
+method steps are:
+
+
+
+initialize a TextEvent
+
+ : Input
+ :: |e|, the {{Event}} to initialize
+ :: |eventType|, a DOMString containing the event type
+ :: |eventTarget|, the {{EventTarget}} of the event
+
+ : Output
+ :: None
+
+ 1. Initialize a UIEvent with |e|, |eventType| and |eventTarget|
+
+ 1. Initialize the following public attributes
+
+ 1. Set event.data = ""
+
+create a TextEvent
+
+ : Input
+ :: |eventType|, a DOMString containing the event type
+ :: |eventTarget|, the {{EventTarget}} of the event
+
+ : Output
+ :: None
+
+ 1. Let |e| = the result of
+ creating a new event using {{TextEvent}}
+ 1. Initialize a TextEvent with |e|, |eventType| and |eventTarget|
+
+ 1. Return |e|
+
+fire a TextEvent
+
+ : Input
+ :: |eventType|, a DOMString containing the event type
+ :: |data|, a DOMString containing event data, or null
+
+ : Output
+ :: None
+
+ 1. Let target =
+ currently focused area of a top-level browsing context
+ 1. Let |event| = result of create a TextEvent with |eventType|, |target|
+ 1. If |data| is null, set |data| to the empty string.
+ 1. Set |event|.{{TextEvent/data}} = |data|
+ 1. Return the result of dispatch |event| at |target|
+
+UI Events Algorithms
- A Collection of Interesting Ideas,
+ A Collection of Interesting Ideas,
Abstract
Note: On macOS: NSKeyDown, NSFlagsChanged (for modifiers without other keys)
+Note: On Windows: WM_KEYDOWN, WM_SYSKEYDOWN
+Note: On macOS: NSKeyDown, NSFlagsChanged (for modifiers without other keys)
An event when a key is released
-Note: On Windows: WM_KEYUP, WM_SYSKEYUP
-Note: On macOS: NSKeyUp, NSFlagsChanged (for modifiers without other keys)
+Note: On Windows: WM_KEYUP, WM_SYSKEYUP
+Note: On macOS: NSKeyUp, NSFlagsChanged (for modifiers without other keys)
An event when a character should be generated as a result of a keypress
Note: On macOS: Combined with keydown
+Note: On Windows: WM_CHAR, WM_SYSCHAR
+Note: On macOS: Combined with keydown
An event when text should be inserted
Note: On macOS: NSTextInputClient with insertText
+Note: On Windows: WM_CHAR (without associated keydown/keyup) +Note: On macOS: NSTextInputClient with insertText
A way to identify key events that are "repeat"s from the key being held down
IMEs differ wildly on different platforms, and often have different capabilities @@ -2295,7 +2438,7 @@
Move to/merge with [DOM] spec Event
interface.
Move to/merge with [DOM] spec Event
interface.
A Event
has the following additional internal state:
None
For reference, see initialize an event, list of event flags.
+For reference, see initialize an event, list of event flags.
Initialize the following public attributes
@@ -2384,7 +2527,7 @@A UIEvent
has the following:
A UIEvent
has the following:
view
detail
@@ -2399,7 +2542,7 @@ event, the UIEvent
to initialize
event, the UIEvent
to initialize
eventType, a DOMString containing the event type
Set event.view
= the eventTarget’s node document’s Window
object
Set event.view
= the eventTarget’s node document’s Window
object
Set event.detail
= 0
Set event.which
= 0 (used by both MouseEvent
and KeyboardEvent
)
Set event.which
= 0 (used by both MouseEvent
and KeyboardEvent
)
If this event is the result of user interaction, then
Set event’s due to user interaction flag
-Note: See uievents/270
+Note: See uievents/270
Set event.isTrusted
= false
A MouseEvent
has the following:
A MouseEvent
has the following:
screenX
screenY
clientX
clientY
- ctrlKey
- shiftKey
- altKey
- metaKey
+ ctrlKey
+ shiftKey
+ altKey
+ metaKey
button
buttons
- relatedTarget
+ relatedTarget
event, the MouseEvent
to initialize
event, the MouseEvent
to initialize
eventType, a DOMString containing the event type
Let event = the result of creating a new event using MouseEvent
Let event = the result of creating a new event using MouseEvent
Initialize a MouseEvent with event, eventType and eventTarget
button
attribute
+ A button ID suitable for storing in the MouseEvent
's button
attribute
event, the MouseEvent
to initialize
native, the native mouse event
None
-Note: Other mouse events can occur between the mousedown and mouseup.
+Note: Other mouse events can occur between the mousedown and mouseup.
Let mbutton be an ID from native that identifies which mouse button was pressed
@@ -2681,7 +2824,7 @@None
-Note: The platform should call this immediately after handle native mouse up for +
Note: The platform should call this immediately after handle native mouse up for mouseups that generate clicks.
dispatch event at target
Note: See pointerevents/100 for info about browsers using PointerEvents and rounded coordinates.
-Note: Any "default action" is handled during dispatch by triggering the activation behavior algorithm for the target. So there is no need for handle that here. +
Note: See pointerevents/100 for info about browsers using PointerEvents and rounded coordinates.
+Note: Any "default action" is handled during dispatch by triggering the activation behavior algorithm for the target. So there is no need for handle that here. However, need to verify that the existing spec handles disabled/css-pointer-events/inert/...
-Note: To handle `HTMLelement.click()`, call this algorithm with native = null and target = `HTMLelement`.
-Note: To handle keyboard-initiated clicks, call this algorithm with native = null and target = currently focused element.
+Note: To handle `HTMLelement.click()`, call this algorithm with native = null and target = `HTMLelement`.
+Note: To handle keyboard-initiated clicks, call this algorithm with native = null and target = currently focused element.
Note: This should be called immediately after handle native mouse click for mouse clicks that generate double clicks.
Note: To handle a context menu triggered by the keyboard, call this algorithm with native = null and target = currently focused element.
+Note: To handle a context menu triggered by the keyboard, call this algorithm with native = null and target = currently focused element.
Set event.composed = true
-Note: Setting composed to true matches current UA behavior, but it makes more sense +
Note: Setting composed to true matches current UA behavior, but it makes more sense for this to be false. See whatwg/html/5453 for discussion.
eventType, a DOMString containing the event type
+eventTarget, the EventTarget
of the event
None
+Let e = the result of creating a new event using InputEvent
Initialize an InputEvent with e, eventType and eventTarget
+Return e
+key, a DOMString containing the string corresponding to the key
+target, the EventTarget
of the event
None
+If suppress key input events flag is set, then
+Exit (since the keydown was canceled)
+Handle historical keypress event here. Return if cancelled.
+Let inputType = null
+Let data = null
+How much of this can be moved into the [[Input Events]] spec? + Issue: List more keys here
+If key is "Backspace", then inputType = "deleteContentBackward"
+If key is "Delete", then inputType = "deleteContentForward"
+Otherwise,
+inputType = "insertText"
+inputType should be "insertParagraph" or "insertLineBreak" when pressing Enter.
+data = key
+If inputType is not null, then
+Note: Need to verify Firefox behavior. +Can be enabled by changing the "dom.input_events.beforeinput_enabled" pref in "about:config"
+Let result = fire an InputEvent with "beforeinput", inputType and data
+If result is false, then return.
+Let textInputData be data.
+Let shouldFireTextInput to true.
+If inputType is either "insertParagraph" or "insertLineBreak", then:
+Set textInputData to "\n".
+If target is an HTMLInputElement
, then set shouldFireTextInput to false.
If inputType is not one of "insertText", "insertParagraph" or "insertLineBreak", then set shouldFireTextInput to false.
+If shouldFireTextInput is true, then:
+Set result = fire a TextEvent with "textInput", and textInputData
+Note: The "textInput" event is obsolete.
+If result is false, then return.
+Note: Perform DOM update here. Insert key into target element
+Note: Compat: +For insertFromPaste, Chrome has data = null, Firefox has data = same as beforeinput.
+Fire an InputEvent with "input", inputType and data
+eventType, a DOMString containing the event type
+inputType, a DOMString containing the input event type
+data, a DOMString containing event data
+None
+What about target ranges? Need to add support here.
+The target for input events should consider focus, but should also ensure that + the element is editable and being modified. + Compare: fire a compositionevent
+Let target = currently focused area of a top-level browsing context
+Let event = result of create an InputEvent with eventType, target
+Set event.inputType
= inputType
Set event.data
= data
Return the result of dispatch event at target
+Note: TextEvent
is obsolete.
See IDL definition in UI Events.
+The data
attribute must return the value it was initialized to.
The initTextEvent(type, bubbles, cancelable, view, data)
method steps are:
If this’s dispatch flag is set, then return.
+Initialize a UIEvent with this, type and eventTarget
+Set this.cancelable
= cancelable
The bubbles/cancelable/view should be parameters to "Initialize a UIEvent" instead of being set twice.
+e, the Event
to initialize
eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Let e = the result of creating a new event using InputEvent
Initialize an InputEvent with e, eventType and eventTarget
+Initialize a UIEvent with e, eventType and eventTarget
Return e
+Initialize the following public attributes
+Set event.data = ""
+key, a DOMString containing the string corresponding to the key
+eventType, a DOMString containing the event type
target, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
If suppress key input events flag is set, then
-Exit (since the keydown was canceled)
-Handle historical keypress event here
-Let inputType = null
-Let data = null
-How much of this can be moved into the [[Input Events]] spec? - Issue: List more keys here
-If key is "Backspace", then inputType = "deleteContentBackward"
-If key is "Delete", then inputType = "deleteContentForward"
+Let e = the result of creating a new event using TextEvent
Otherwise,
-inputType = "insertText"
-data = key
-Initialize a TextEvent with e, eventType and eventTarget
If inputType is not null, then
-Note: Need to verify Firefox behavior. -Can be enabled by changing the "dom.input_events.beforeinput_enabled" pref in "about:config"
-Let result = fire an InputEvent with "beforeinput", inputType and data
-If result is true
-Note: Perform DOM update here. Insert key into target element
-Note: Compat: -For insertFromPaste, Chrome has data = null, Firefox has data = same as beforeinput.
-Fire an InputEvent with "input", inputType and data
-Return e
eventType, a DOMString containing the event type
inputType, a DOMString containing the input event type
-data, a DOMString containing event data
+data, a DOMString containing event data, or null
None
What about target ranges? Need to add support here.
-The target for input events should consider focus, but should also ensure that - the element is editable and being modified. - Compare: fire a compositionevent
Let target = currently focused area of a top-level browsing context
Let event = result of create an InputEvent with eventType, target
+Let event = result of create a TextEvent with eventType, target
Set event.inputType
= inputType
If data is null, set data to the empty string.
Set event.data
= data
Set event.data
= data
Return the result of dispatch event at target
+Return the result of dispatch event at target
A KeyboardEvent
has the following:
A KeyboardEvent
has the following:
DOM_KEY_LOCATION_STANDARD
DOM_KEY_LOCATION_LEFT
@@ -3107,7 +3376,7 @@ keyCode
- keyChar
+ keyChar
And the following internal state:
The UA must maintain the following values that are shared for the entire User Agent.
A key modifier state (initially empty) that keeps track of the current state of each modifier key available on the system.
-The UA must maintain the following values that are shared for the Window.
A suppress key input events flag (initially false) that is used to suppress input events when the initial keydown event is canceled.
event, the KeyboardEvent
to initialize
event, the KeyboardEvent
to initialize
eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Initialize a UIEvent with event, eventType and eventTarget
+Initialize a UIEvent with event, eventType and eventTarget
Initialize the following public attributes
Initialize the following internal state
@@ -3198,20 +3467,20 @@eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Let e = the result of creating a new event using KeyboardEvent
Let e = the result of creating a new event using KeyboardEvent
Initialize a KeyboardEvent with e, eventType and eventTarget
event, the KeyboardEvent
or MouseEvent
to update
event, the KeyboardEvent
or MouseEvent
to update
None
@@ -3255,11 +3524,11 @@event, the KeyboardEvent
to initialize
event, the KeyboardEvent
to initialize
nativeKey, native key info
Set event.keyCode
= ???
Set event.charCode
= ???
Set event.charCode
= ???
Set event.which
= ???
event, the KeyboardEvent
to initialize
event, the KeyboardEvent
to initialize
modifier, a DOMString containing the name of the modifier key
If Keyboard Lock is enabled, then return false
-Note: Keyboard Lock is not an official standard. This is demonstrating +
Note: Keyboard Lock is not an official standard. This is demonstrating how it might be integrated.
These key shortcuts are defined by the User Agent (e.g., Cmd-T on Mac). @@ -3416,7 +3685,7 @@
If handle pre browser key with nativeKey, then
-Note: Chrome/Firefox handle some BrowserKeys before generating keydown events. +
Note: Chrome/Firefox handle some BrowserKeys before generating keydown events. Tested with ctrl-t (to create new tab)
set KeyboardEvent attributes with event, nativeKey
Let result = dispatch event at target
-Note: when in composition, canceling the keydown has no effect +
Let result = dispatch event at target
+Note: when in composition, canceling the keydown has no effect (tested: macOS Chrome; TODO: test other configs)
If the in composition flag is set, then
@@ -3517,7 +3786,7 @@set KeyboardEvent attributes with event, nativeKey
dispatch event at target
+dispatch event at target
None
Note: This may be called directly if the native platform generates CHAR events that +
Note: This may be called directly if the native platform generates CHAR events that are separate from keydown events. Or it may be called from handle native key down.
The UA must maintain the following values that are shared for the Window.
A composition mode flag (initially false) that is set if the native IME is enabled and the next key press will trigger compositionstart.
An in composition flag (initially false) that tracks if the system is currently in the middle of input composition (i.e., after compositionstart but before compositionend).
e, the Event
to initialize
e, the Event
to initialize
eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Initialize a UIEvent with e, eventType and eventTarget
+Initialize a UIEvent with e, eventType and eventTarget
Initialize the following public attributes
Set event.data = ""
-Note: This attribute has the same name as an attribute in InputEvent.
+Note: This attribute has the same name as an attribute in InputEvent.
eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Let e = the result of creating a new event using CompositionEvent
Let e = the result of creating a new event using CompositionEvent
Initialize a CompositionEvent with e, eventType and eventTarget
Let event = result of create a CompositionEvent with eventType, target
Set event.data
= data
Set event.data
= data
Return the result of dispatch event at target
+Return the result of dispatch event at target
None
Note: This is called when a key is added to the composition buffer, or when the +
Note: This is called when a key is added to the composition buffer, or when the user navigates between composition options.
-Note: This is where the IME handles the UI part to navigate the candidates or accept +
Note: This is where the IME handles the UI part to navigate the candidates or accept all or part of the text. Not sure how much (if any) of this makes sense to "specify" here since it is controlled by the IME.
Fire an InputEvent with "input", "insertCompositionText" and data
-Note: Not cancelable
+Note: Not cancelable
Compat: Chrome sends out beforeinput/compositionupdate/input sequence before +
Compat: Chrome sends out beforeinput/compositionupdate/textInput/input sequence before compositionend (tested on macOS). Compare with Firefox.
Set result = fire a TextEvent with "textInput", and data
+Note: The "textInput" event is obsolete.
+If result is false, then return.
+Let data = the current composition candidate string
The contents of this section should eventually be moved into the PointerEvent spec.
event, the PointerEvent
to initialize
event, the PointerEvent
to initialize
eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
@@ -3838,20 +4114,20 @@eventType, a DOMString containing the event type
eventTarget, the EventTarget
of the event
eventTarget, the EventTarget
of the event
None
Let event = the result of creating a new event using PointerEvent
Let event = the result of creating a new event using PointerEvent
Initialize a PointerEvent with event, eventType and eventTarget
eventType, a DOMString containing the event type
mouseevent, the corresponding MouseEvent
mouseevent, the corresponding MouseEvent
None
Let event = the result of creating a new event using PointerEvent
Let event = the result of creating a new event using PointerEvent
Let target = mouseevent.target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -3902,15 +4178,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -3924,15 +4200,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -3946,15 +4222,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -3968,15 +4244,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -3992,15 +4268,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -4016,15 +4292,15 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
mouseout, the corresponding mouseout MouseEvent
mouseout, the corresponding mouseout MouseEvent
None
@@ -4040,33 +4316,33 @@Let target = mouseout.target
dispatch pointerout at target
+dispatch pointerout at target
The contents of this section should eventually be moved into the [PointerLock] spec
-Note: The algorithms here are an oversimplification since they don’t account for the lock/unlock +
The contents of this section should eventually be moved into the [PointerLock] spec
+Note: The algorithms here are an oversimplification since they don’t account for the lock/unlock state the or the pointer leaving and re-entering the UA screen boundaries. That should be fixed as part of moving this section to the PointerLock spec.
-A MouseEvent
has the following:
A MouseEvent
has the following:
movementX
movementY
The UA must maintain the following values that are shared for the Window.
A last mouse move value (initially undefined) that records the position of the last mousemove event.
event, a MouseEvent
event, a MouseEvent
None
@@ -4079,11 +4355,11 @@event, a MouseEvent
event, a MouseEvent
None
@@ -4113,21 +4389,21 @@KeyboardLock is not yet an accepted standard and is included here as a placeholder to explore how it might be integrated.
-The contents of this section should eventually be moved into the [WICG-Keyboard-Lock] spec
-The contents of this section should eventually be moved into the [WICG-Keyboard-Lock] spec
+The UA must maintain the following values that are shared for the entire User Agent.
-The UA must maintain the following values that are shared for the Window.
A keyboard lock enable flag (initially false) that tracks whether Keyboard Lock is currently enabled.
These definitions probably belong in another spec.
Return [CSSOM-View]'s elementFromPoint with pos
+Return [CSSOM-View]'s elementFromPoint with pos
The contents of this section should eventually be moved into the [CSSOM] spec
+The contents of this section should eventually be moved into the [CSSOM] spec
event, a MouseEvent
event, a MouseEvent
None
@@ -4213,10 +4489,10 @@Should these be moved into the Clipboard spec?
None
Note: No input events fired
+Note: No input events fired
Define when "copy" event is fired. Should that be in the Clipboard Spec?
None
Note: This is intended to be called when the UA triggers a paste action (via user action)
+Note: This is intended to be called when the UA triggers a paste action (via user action)
Define when the "paste" event is fired.
Let result = fire an InputEvent with "beforeinput", "insertFromPaste" and data
If result is true, then
+If result is false, then return.
+Set result = fire a TextEvent with "textInput", and data
+Note: The "textInput" event is obsolete.
+If result is false, then return.
Paste clipboard contents into DOM target element
Thanks to the following for their contributions to this document:
All of the text of this specification is normative - except sections explicitly marked as non-normative, examples, and notes. [RFC2119]
+ except sections explicitly marked as non-normative, examples, and notes. [RFC2119] Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with class="example"
, like this:
Informative notes begin with the word “Note”
and are set apart from the normative text with class="note"
, like this:
Note, this is an informative note.
+Note, this is an informative note.
Window
, Document
, Element
|
+| Cancelable | No |
+| Default action | None |
- +| ContextWindow
Window
, Document
, Element
|
+| Cancelable | No |
+| Default action | None |
- +| ContextWindow
Window
, Element
|
+| Cancelable | No |
+| Default action | None |
- +| ContextWindow
Window
, Element
|
+| Cancelable | No |
+| Default action | None |
- +| ContextWindow
Element
|
+| Cancelable | No |
+| Default action | None |
- +| ContextWindow
0
Window
0
Window
0
Window
0
Window
0
0
.
{ buttons: 2 | 4 }
- or: { buttons: 2 | 4 }
{ buttons: 6 }
@@ -1139,7 +1139,7 @@ events.
B, and B is a child of A in the DOM:
@@ -1253,7 +1253,7 @@ events.
+| Cancelable | Yes |
+| Composed | Yes |
+| Default action | Varies |
- +| ContextWindow
- Receiving and handling auxclick for the middle button.
+ Receiving and handling auxclick for the middle button.
myLink.addEventListener("auxclick", function(e) {
if (e.button === 1) {
// This would prevent the default behavior which is for example
@@ -1346,7 +1346,7 @@ events.
- Receiving and handling auxclick for the right button
- The KEYCAP{Q} key on a PC 101 Key US keyboard.
+ Receiving and handling auxclick for the right button
myDiv.addEventListener("contextmenu", function(e) {
// This call makes sure no context menu is shown
// to interfere with page receiving the events.
@@ -1374,7 +1374,7 @@ myDiv.addEventListener("auxclick", function(e) {
+| Cancelable | Yes |
+| Composed | Yes |
+| Default action | Varies |
- +| Context
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
Window
0
- The KEYCAP{NumLock} key on a PC 101 Key US keyboard.
+ The KEYCAP{Q} key on a PC 101 Key US keyboard.
+ The KEYCAP{NumLock} key on a PC 101 Key US keyboard.
The KEYCAP{1} key on a PC 101 Key US keyboard located in the
main section of the keyboard.
| |
+ +| Context
| |
| (trusted events) |
| |
+ +| Context
| |
| (trusted events) |
| Notes |
+ =| # | Event Type | {{CompositionEvent}}
| Notes |
| | | {{CompositionEvent/data}} | |
+---+-------------------+------------o--------------+------------------------------+
+| 1 | compositionstart | ""
| |
@@ -3233,7 +3233,7 @@ myDiv.addEventListener("auxclick", function(e) {
{{KeyboardEvent/isComposing}} attribute set to true
.
++---+-------------------+-------------------------------+------------------------------+
- =| # | Event Type | {{KeyboardEvent}}
| Notes |
+ =| # | Event Type | {{KeyboardEvent}}
| Notes |
| | | {{KeyboardEvent/isComposing}} | |
+---+-------------------+--------------o----------------+------------------------------+
+| 1 | keydown | false | This is the key event that |
@@ -3302,7 +3302,7 @@ myDiv.addEventListener("auxclick", function(e) {
+| Cancelable | Yes |
+| Composed | Yes |
+| Default action | Start a new composition session when a text composition system is enabled |
- +| Context
| |
+ +| Context
| |
| (trusted events) |
Window
0
| |
+ +| Context
| |
| (trusted events) |
null
if not accessibleWindow
| |
+ +| Context
| |
| (trusted events) |
Window
0
|{{KeyboardEvent}}
| Notes |
+ =| Keyboard |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
| Layout |{{KeyboardEvent/key}} |{{KeyboardEvent/code}}| |
+----------+----------o-----------+----------o-----------+------------------------------------------+
+| US | KEY{Alt} | CODE{AltLeft} | {{KeyboardEvent/DOM_KEY_LOCATION_LEFT}} |
@@ -151,7 +151,7 @@ unavailable in the PDF version or printed version of this specification.
Handling the Single Quote Key
++----------+----------------------+----------------------+--------+
- =| Keyboard |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
+ =| Keyboard |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
| Layout |{{KeyboardEvent/key}} |{{KeyboardEvent/code}}| |
+----------+----------o-----------+-----------o----------+--------+
+| US | KEY_NOLINK{'} | CODE{Quote} | |
@@ -170,7 +170,7 @@ unavailable in the PDF version or printed version of this specification.
various keyboard layouts.
++----------+----------------------+----------------------+----------------------------+
- =| Keyboard |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
+ =| Keyboard |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
| Layout |{{KeyboardEvent/key}} |{{KeyboardEvent/code}}| |
+----------+----------o-----------+----------o-----------+----------------------------+
+| US | KEY_NOLINK{2} | CODE{Digit2} | |
@@ -198,7 +198,7 @@ unavailable in the PDF version or printed version of this specification.
(down), KEYCAP{2} (up), KEYCAP{Shift} (up).
++---+----------+----------------------+----------------------+-----------------------------------------+
- =| # | Event |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
+ =| # | Event |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
| | Type |{{KeyboardEvent/key}} |{{KeyboardEvent/code}}| |
+---+----------+----------o-----------+----------o-----------+-----------------------------------------+
+| 1 | keydown | KEY{Shift} | CODE{ShiftLeft} | {{KeyboardEvent/DOM_KEY_LOCATION_LEFT}} |
@@ -213,7 +213,7 @@ unavailable in the PDF version or printed version of this specification.
KEYCAP{2} (down), KEYCAP{Shift} (up), KEYCAP{2} (up).
++---+----------+----------------------+----------------------+-----------------------------------------+
- =| # | Event |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
+ =| # | Event |{{KeyboardEvent}}
|{{KeyboardEvent}}
| Notes |
| | Type |{{KeyboardEvent/key}} |{{KeyboardEvent/code}}| |
+---+----------+----------o-----------+----------o-----------+-----------------------------------------+
+| 1 | keydown | KEY{Shift} | CODE{ShiftLeft} | {{KeyboardEvent/DOM_KEY_LOCATION_LEFT}} |
@@ -367,7 +367,7 @@ unavailable in the PDF version or printed version of this specification.
keyboard using a US mapping:
++---+-------------+----------------------+----------------------------+------------------------+
- =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} | | |
+---+-------------+----------o-----------+-------------o--------------+------------------------+
+| 1 | keydown | KEY{Shift} | {{KeyboardEvent/shiftKey}} | |
@@ -386,7 +386,7 @@ unavailable in the PDF version or printed version of this specification.
unshifted value for the EVENT{keyup} event:
++---+-------------+----------------------+----------------------------+------------------------+
- =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} | | |
+---+-------------+----------o-----------+-------------o--------------+------------------------+
+| 1 | keydown | KEY{Shift} | {{KeyboardEvent/shiftKey}} | |
@@ -404,7 +404,7 @@ unavailable in the PDF version or printed version of this specification.
as the previous example):
++---+-------------+----------------------+----------------------------+----------------------------+
- =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} | | |
+---+-------------+----------o-----------+-------------o--------------+----------------------------+
+| 1 | keydown | KEY{Control} | {{KeyboardEvent/ctrlKey}} | |
@@ -422,7 +422,7 @@ unavailable in the PDF version or printed version of this specification.
KEYCAP{Control} are pressed:
++---+-------------+----------------------+----------------------------+----------------------------+
- =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} | | |
+---+-------------+----------o-----------+-------------o--------------+----------------------------+
+| 1 | keydown | KEY{Control} | {{KeyboardEvent/ctrlKey}} | |
@@ -447,7 +447,7 @@ unavailable in the PDF version or printed version of this specification.
used:
++---+-------------+----------------------+----------------------------+----------------------------+
- =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} | | |
+---+-------------+----------o-----------+-------------o--------------+----------------------------+
+| 1 | keydown | KEY{Control} | {{KeyboardEvent/ctrlKey}} | |
@@ -514,7 +514,7 @@ unavailable in the PDF version or printed version of this specification.
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
| | |{{KeyboardEvent/key}} |{{KeyboardEvent/isComposing}}|{{CompositionEvent/data}}| |
+---+-------------------+----------o-----------+-------------o---------------+------------o------------+----------------------+
+| 1 | keydown | KEY{Dead} | false
| | Combining Circumflex |
@@ -542,7 +542,7 @@ unavailable in the PDF version or printed version of this specification.
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
| | |{{KeyboardEvent/key}} |{{KeyboardEvent/isComposing}}|{{CompositionEvent/data}}| |
+---+-------------------+----------o-----------+--------------o--------------+------------o------------+----------------------+
+| 1 | keydown | KEY{Dead} | false
| | Combining Circumflex |
@@ -599,7 +599,7 @@ unavailable in the PDF version or printed version of this specification.
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
| | |{{KeyboardEvent/key}} |{{KeyboardEvent/isComposing}}|{{CompositionEvent/data}}| |
+----+-------------------+----------o-----------+--------------o--------------+------------o------------+----------------------+
+| 1 | keydown | KEY_NOLINK{s} | false
| | Latin Small Letter S |
@@ -641,7 +641,7 @@ unavailable in the PDF version or printed version of this specification.
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{KeyboardEvent}}
|{{CompositionEvent}}
| Notes |
| | |{{KeyboardEvent/key}} |{{KeyboardEvent/isComposing}}|{{CompositionEvent/data}}| |
+----+-------------------+----------o-----------+--------------o--------------+------------o------------+----------------------+
+| 1 | keydown | KEY_NOLINK{s} | false
| | Latin Small Letter S |
@@ -712,7 +712,7 @@ unavailable in the PDF version or printed version of this specification.
|{{InputEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{InputEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} |{{InputEvent/data}} | | |
+---+-------------+----------o-----------+---------o----------+--------------o-------------+-----------------------------------+
+| 1 | keydown | KEY{Shift} | | {{KeyboardEvent/shiftKey}} | |
@@ -735,7 +735,7 @@ unavailable in the PDF version or printed version of this specification.
|{{InputEvent}}
| Modifiers | Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{InputEvent}}
| Modifiers | Notes |
| | |{{KeyboardEvent/key}} |{{InputEvent/data}} | | |
+---+-------------+----------o-----------+---------o----------+--------------o-------------+-----------------------------------+
+| 1 | keydown | KEY{Shift} | | {{KeyboardEvent/shiftKey}} | The default action is |
@@ -761,7 +761,7 @@ unavailable in the PDF version or printed version of this specification.
|{{InputEvent}}
| Notes |
+ =| # | Event Type |{{KeyboardEvent}}
|{{InputEvent}}
| Notes |
| | |{{KeyboardEvent/key}} |{{InputEvent/data}} | |
+---+-------------+----------o-----------+---------o----------+-----------------------------------+
+| 1 | keydown | KEY{Dead} | | The default action is |
diff --git a/sections/legacy-event-types.txt b/sections/legacy-event-types.txt
index fcacea43..f205d349 100644
--- a/sections/legacy-event-types.txt
+++ b/sections/legacy-event-types.txt
@@ -51,6 +51,7 @@ completeness.
+| keypress | Sync | Yes | Element
| KeyboardEvent | Yes | Yes | Varies: launch text composition system; |
| | | | | | | | EVENT{blur} and EVENT{focus} events; |
| | | | | | | | EVENT{DOMActivate} event; other event |
++| textInput | Sync | Yes | Element
| TextEvent | Yes | Yes | See definition |
++-----------------------------+--------+----------+------------------------------------------+------------------+------------+------------+------------------------------------------------+
@@ -94,7 +95,7 @@ completeness.
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
-
Context
+
(trusted events)Context
(trusted events)
| {{InputEvent}}
| Notes |
+ =| # | Event Type | {{KeyboardEvent}}
| {{InputEvent}}
| Notes |
| | | {{KeyboardEvent/key}} | {{InputEvent/data}} | |
+---+-------------+-----------o------------+----------o----------+--------------------------------+
+| 1 | keydown | KEY_NOLINK{a} | | |
@@ -517,6 +518,23 @@ completeness.
++---+-------------+------------------------+---------------------+--------------------------------+
Legacy {{TextEvent}} events
+
+
+[Exposed=Window]
+interface TextEvent : UIEvent {
+ readonly attribute DOMString data;
+ undefined initTextEvent(DOMString type,
+ optional boolean bubbles = false,
+ optional boolean cancelable = false,
+ optional Window? view = null,
+ optional DOMString data = "undefined");
+};
+
+
+Issue: See Text Event section in UI Events Algorithms for the {{TextEvent}} interface and the textInput event.
+
+
Legacy {{MutationEvent}} events
The mutation and mutation name event modules are designed to allow
@@ -762,7 +780,7 @@ completeness.
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
-
Context
+
(trusted events)Context
(trusted events)
None
- Context
+
(trusted events)Context
(trusted events)
Code | |
+ | |
Code | |
+------------+------o------+---o---+
+| Backspace | 8 | |
+| Tab | 9 | |
@@ -283,7 +283,7 @@ used.
++------------------------+-----------------+-------------+
=| Key | Character | Virtual Key |
- | | |
Code |
+ | | |
Code |
+------------------------+--------o--------+------o------+
+| Semicolon | GLYPH{;} | 186 |
+| Colon | GLYPH{:} | 186 |