Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年7月.
* Some parts of this feature may have varying levels of support.
pointerType は PointerEvent インターフェイスの読み取り専用プロパティで、特定のポインターイベントを引き起こした機器の種類(マウス、ペン、タッチのいずれか)を示します。
このイベントのポインターの種類です。対応している値は以下の文字列です。
"mouse"このイベントはマウス機器によって生成されました。
"pen"このイベントはペン機器またはスタイラス機器によって生成されました。
"touch"このイベントは指などのタッチによって生成されました。
機器の種類がブラウザーで検出できない場合、値は空の文字列 ("") になります。 ブラウザーが上記以外のポインター機器の種類に対応している場合は、他の種類の機器と名前が競合しないように、値に ベンダー接頭辞 をつける必要があります。
この例は、pointerType プロパティの値を使用して適切なポインターの種類の処理関数を呼び出す方法を示しています。
| Pointer Events # dom-pointerevent-pointertype |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2024年9月10日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.