-
Notifications
You must be signed in to change notification settings - Fork 8k
/
index.md
100 lines (72 loc) · 4.55 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
title: "Element: pointermove イベント"
short-title: pointermove
slug: Web/API/Element/pointermove_event
l10n:
sourceCommit: 7b3ccaec4a93584da12939587ea746acaabe30bc
---
{{APIRef}}
`pointermove` はポインターの座標が変化し、かつブラウザーの[タッチ操作](/ja/docs/Web/CSS/touch-action)によってポインターが[キャンセル](/ja/docs/Web/API/Element/pointercancel_event)されていないときに発生します。
## 構文
このイベント名を {{domxref("EventTarget.addEventListener", "addEventListener()")}} などのメソッドで使用するか、イベントハンドラープロパティを設定するかしてください。
```js
addEventListener("pointermove", (event) => {});
onpointermove = (event) => {};
```
## イベント型
{{domxref("PointerEvent")}} です。 {{domxref("Event")}} を継承しています。
{{InheritanceDiagram("PointerEvent")}}
## イベントプロパティ
_このインターフェイスは {{domxref("MouseEvent")}} および {{domxref("Event")}} からプロパティを継承しています。_
- {{ domxref('PointerEvent.pointerId')}} {{ReadOnlyInline}}
- : イベントを発生させたポインターの固有の識別子です。
- {{ domxref('PointerEvent.width')}} {{ReadOnlyInline}}
- : ポインターが接触するジオメトリーの幅(X 軸の大きさ、CSS ピクセル単位)。
- {{ domxref('PointerEvent.height')}} {{ReadOnlyInline}}
- : ポインターが接触するジオメトリーの高さ(Y 軸の大きさ、CSS ピクセル単位)。
- {{ domxref('PointerEvent.pressure')}} {{ReadOnlyInline}}
- : ポインター入力の正規化された圧力で、範囲は `0` から `1` です。ここで `0` と `1` は、それぞれハードウェアが検出可能な最小圧力と最大圧力を表します。
- {{ domxref('PointerEvent.tangentialPressure')}} {{ReadOnlyInline}}
- : ポインタ入力の正規化された接線圧力(バレル圧力またはシリンダー応力([cylinder stress](https://en.wikipedia.org/wiki/Cylinder_stress))とも呼ばれます)で、 `-1` から `1` の範囲であり、 `0` はコントロールの中立位置です。
- {{ domxref('PointerEvent.tiltX')}} {{ReadOnlyInline}}
- : Y-Z 平面と、ポインター(ペンスタイラスなど)の軸と Y 軸の両方を含む平面との間の平面角度(度単位、 `-90` から `90` の範囲)。
- {{ domxref('PointerEvent.tiltY')}} {{ReadOnlyInline}}
- : X-Z 平面と、ポインター(ペンスタイラスなど)の軸と X 軸の両方を含む平面との間の平面角度(度単位、 `-90` から `90` の範囲)。
- {{ domxref('PointerEvent.twist')}} {{ReadOnlyInline}}
- : ポインター(ペンスタイラスなど)の長軸を中心とした時計回りの回転の度数(`0` から `359` の範囲の値)。
- {{ domxref('PointerEvent.pointerType')}} {{ReadOnlyInline}}
- : イベントの原因となった機器の種類(マウス、ペン、タッチなど)を示します。
- {{ domxref('PointerEvent.isPrimary')}} {{ReadOnlyInline}}
- : このポインターがこのポインター種別の主ポインターを表すかどうかを示します。
## 使用上のメモ
このイベントは {{domxref("PointerEvent")}} 型で、位置、移動距離、ボタンの状態など、ユーザーとポインティングデバイスとの対話について知る必要のあるすべての情報を提供します。
## 例
`addEventListener()` を使用した例です。
```js
const para = document.querySelector("p");
para.addEventListener("pointermove", (event) => {
console.log("Pointer moved");
});
```
`onpointermove` イベントハンドラープロパティを使用した例です。
```js
const para = document.querySelector("p");
para.onpointermove = (event) => {
console.log("Pointer moved");
};
```
## 仕様書
{{Specifications}}
## ブラウザーの互換性
{{Compat}}
## 関連情報
- 関連イベント
- [`gotpointercapture`](/ja/docs/Web/API/Element/gotpointercapture_event)
- [`lostpointercapture`](/ja/docs/Web/API/Element/lostpointercapture_event)
- [`pointerover`](/ja/docs/Web/API/Element/pointerover_event)
- [`pointerenter`](/ja/docs/Web/API/Element/pointerenter_event)
- [`pointerdown`](/ja/docs/Web/API/Element/pointerdown_event)
- [`pointerup`](/ja/docs/Web/API/Element/pointerup_event)
- [`pointercancel`](/ja/docs/Web/API/Element/pointercancel_event)
- [`pointerout`](/ja/docs/Web/API/Element/pointerout_event)
- [`pointerleave`](/ja/docs/Web/API/Element/pointerleave_event)