isPrimary
isPrimary
This page has been flagged with the following issues:
High-level issues:
W3C Working Draft
Summary
Indicates if the pointer represents the primary pointer.
Property of dom/PointerEvent
Syntax
Note: This property is read-only.
var result = event.isPrimary;
Needs Examples: This section should include examples.
Usage
In a multi-pointer (e.g. multi-touch) scenario, the primary pointer is used to identify a master pointer amongst the set of active pointers. This pointer is the one that will produce compatibility mouse events. It is also useful when single-pointer interaction is desired by an author.
When dispatching a pointer event, a pointer is considered primary if:
- The pointer represents a mouse device.
- The pointer represents primary touch input, where its pointerdown event was dispatched when no other active pointers representing touch input existed.
- The pointer represents primary pen input, where its pointerdown event was dispatched when no other active pointers representing pen input existed.
Notes
In some platforms, the primary pointer is determined using all active pointers on the device including those not targeted at the user agent (e.g. in another application). This means it is possible for the user agent to fire pointer events in which no pointer is marked as the primary pointer. For example, if the first touch interaction is targeted outside the user agent and a secondary (multi-touch) touch interaction is targeted inside the user agent, then the user agent fires pointer events for the second contact with a value of false for isPrimary.
Related specifications
| Specification | Status | Related Changes |
|---|---|---|
| Pointer Events | Working Draft | 3.1.2 |
Compatibility
Desktop
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic Support | ? | ? | IE10 | ? |
? |
Mobile
| Feature | Android | BlackBerry | Chrome for mobile | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Opera Mini | Safari Mobile |
|---|---|---|---|---|---|---|---|---|
| Basic support | ? | ? | ? | ? | ? | ? | ? | ? |
Compatibility notes
| Browser | Version | Note |
|---|---|---|
| Internet Explorer | 10 | The PointerEvent object and associated events are supported with the MS prefix. E.g., MSPointerEvent |
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here