Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. InputDeviceCapabilities
  4. firesTouchEvents

InputDeviceCapabilities: firesTouchEvents property

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

ThefiresTouchEvents read-only property of theInputDeviceCapabilities interface returns a boolean value that indicates whether the device dispatches touch events.

You can use this property to detect mouse events that represent an action that mayalready have been handled by touch event handlers. This doesn't necessarily mean thedevice is a touch screen. For example, stylus and mouse devices typically generatetouch events on mobile browsers.

Value

ABoolean

Example

js
myButton.addEventListener("mousedown", (e) => {  if (!e.sourceCapabilities.firesTouchEvents) myButton.classList.add("pressed");});

Specifications

Specification
Input Device Capabilities
# dom-inputdevicecapabilities-firestouchevents

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp