![]() one top-level browsing context cannot assume that the pointerId of a pointer will be the same when the pointer moves outside of the browsing context and into another top-level browsing context). However, all active pointers in the (as defined by ]) must be unique, and the identifier MUST NOT be influenced by any other top-level browsing context (i.e. For any other pointers, user agents are free to implement different strategies and approaches in how they assign a pointerId value. The pointerId value of -1 MUST be reserved and used to indicate events that were generated by something other than a pointing device. User agents MAY reserve a generic pointerId value of 0 or 1 for the primary mouse pointer. sequence getCoalescedEvents() Ī unique identifier for the pointer causing the event. Readonly attribute DOMString pointerType Readonly attribute float tangentialPressure The events for handling generic pointer input look a lot like those for mouse: ) A pointer is a hardware agnostic representation of input devices that can target a specific coordinate (or set of coordinates) on a screen. See WCAG Guideline 2.1 Keyboard Accessible ] for further details. In the case of keyboards and keyboard-like interfaces, this might require the addition of explicit keyboard event handling. However, when using low-level events (such as Pointer Events), authors are encouraged to ensure that all types of input are supported. In the first instance, authors are encouraged to provide equivalent functionality for all forms of input by responding to high-level events such as focus, blur and click. While user agents might choose to also generate pointer events in response to these interfaces, this scenario is not covered in this specification. While this specification defines a unified event model for a variety of pointer inputs, this model does not cover other forms of input such as keyboards or keyboard-like interfaces (for instance, a screen reader or similar assistive technology running on a touchscreen-only device, which allows users sequential navigation through focusable controls and elements). The primary goal is to provide a single set of events and interfaces that allow for easier authoring for cross-device pointer input while still allowing for device-specific handling only when necessary for an augmented experience.Īn additional key goal is to enable multi-threaded user agents to handle direct manipulation actions for panning and zooming (for instance, with a finger or stylus on a touchscreen), without blocking on script execution. For scenarios when device-specific handling is desired, this specification also defines properties for inspecting the device type which produced the event. This model makes it easier to write sites and applications that work well no matter what hardware the user has. ![]() A pointer can be any point of contact on the screen made by a mouse cursor, pen, touch (including multi-touch), or other pointing input device. To reduce the cost of coding to multiple input types and also to help with the above described ambiguity with Mouse Events, this specification defines a more abstract form of input, called a pointer. This makes it ambiguous whether a Mouse Event represents an actual mouse device or is being produced from another input type for compatibility, which makes it hard to code to both device types simultaneously. ![]() Additionally, for compatibility with existing mouse-based content, most user agents fire Mouse Events for all input types. This often creates a compatibility problem when content is written with only one device type in mind. However, that approach often incurs unnecessary duplication of logic and event handling overhead when adding support for a new input type. Event types have been proposed for handling each of these forms of input individually. Newer computing devices today, however, incorporate other forms of input, including touchscreens, pen input, etc. Those that handle input in a custom manner typically code to ] Mouse Events. Today, most ] content is used with and/or designed for mouse input. Level 3 includes editorial clarifications and new features that facilitate more use cases, in an effort to enable wider developer and browser adoption. ![]() This specification is an update to ] which was shipped broadly by Google Chrome and Microsoft Edge and Mozilla Firefox. For compatibility with existing mouse based content, this specification also describes a mapping to fire Mouse Events for other pointer device types. The features in this specification extend or modify those found in Pointer Events, a W3C Recommendation that describes events and related interfaces for handling hardware agnostic pointer input from devices including a mouse, pen, touchscreen, etc.
0 Comments
Leave a Reply. |