A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/Navigator/pointerEnabled below:

pointerEnabled ยท WebPlatform Docs

pointerEnabled Summary

Indicates if the browser will fire pointer events for pointing input.

In late 2013, pointerEnabled was removed from the specification as checking PointerEvent in Window object is sufficient for feature detection. Do not use this property and use PointerEvent instead.

Property of dom/Navigatordom/Navigator

Syntax

Note: This property is read-only.

var result = navigator.pointerEnabled;
Return Value

Returns an object of type BooleanBoolean

Examples

Basic HTML5 Canvas painting application

<style>
  /* Disable intrinsic user agent touch behaviors (such as panning or zooming) so
  that all events are given to the application instead. */

  html {
    touch-action: none;
  }
</style>

<canvas id="drawSurface" width="500px" height="500px" style="border:1px solid black;"></canvas>

<script type='text/javascript'>
window.addEventListener('load', function() {
  var canvas = document.getElementById("drawSurface"),
  context = canvas.getContext("2d");
  if (window.navigator.pointerEnabled) {
    canvas.addEventListener("pointermove", paint, false);
    if(window.navigator.maxTouchPoints>1)
        alert("Your user agent and hardware support multi-touch!");
  }
  else {
    //Provide fallback for user agents that do not support Pointer Events
    canvas.addEventListener("mousemove", paint, false);
  }
  function paint(event) {
    if(event.buttons>0)
        context.fillRect(event.clientX, event.clientY, 5, 5);
  }
});
Notes

In late 2013, pointerEnabled was removed from the specification as checking PointerEvent in Window object is sufficient for feature detection. Do not use this property and use PointerEvent instead.

Related specifications
Pointer Events
Candidate Recommendation
See also Related articles Pointer Events Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4