@@ -38,21 +38,50 @@ enum PointerChange {
38
38
up,
39
39
40
40
/// A pan/zoom has started on this pointer.
41
+ ///
42
+ /// This type of event will always have kind [PointerDeviceKind.trackpad] .
41
43
panZoomStart,
42
44
43
45
/// The pan/zoom on this pointer has updated.
46
+ ///
47
+ /// This type of event will always have kind [PointerDeviceKind.trackpad] .
44
48
panZoomUpdate,
45
49
46
50
/// The pan/zoom on this pointer has ended.
51
+ ///
52
+ /// This type of event will always have kind [PointerDeviceKind.trackpad] .
47
53
panZoomEnd,
48
54
}
49
55
50
56
/// The kind of pointer device.
51
57
enum PointerDeviceKind {
52
58
/// A touch-based pointer device.
59
+ ///
60
+ /// The most common case is a touch screen.
61
+ ///
62
+ /// When the user is operating with a trackpad on iOS, clicking will also
63
+ /// dispatch events with kind [touch] if
64
+ /// `UIApplicationSupportsIndirectInputEvents` is not present in `Info.plist`
65
+ /// or returns NO.
66
+ ///
67
+ /// See also:
68
+ ///
69
+ /// * [UIApplicationSupportsIndirectInputEvents] (https://developer.apple.com/documentation/bundleresources/information_property_list/uiapplicationsupportsindirectinputevents?language=objc).
53
70
touch,
54
71
55
72
/// A mouse-based pointer device.
73
+ ///
74
+ /// The most common case is a mouse on the desktop or Web.
75
+ ///
76
+ /// When the user is operating with a trackpad on iOS, moving the pointing
77
+ /// cursor will also dispatch events with kind [mouse] , and clicking will
78
+ /// dispatch events with kind [mouse] if
79
+ /// `UIApplicationSupportsIndirectInputEvents` is not present in `Info.plist`
80
+ /// or returns NO.
81
+ ///
82
+ /// See also:
83
+ ///
84
+ /// * [UIApplicationSupportsIndirectInputEvents] (https://developer.apple.com/documentation/bundleresources/information_property_list/uiapplicationsupportsindirectinputevents?language=objc).
56
85
mouse,
57
86
58
87
/// A pointer device with a stylus.
@@ -61,7 +90,31 @@ enum PointerDeviceKind {
61
90
/// A pointer device with a stylus that has been inverted.
62
91
invertedStylus,
63
92
64
- /// A touch-based pointer device with an indirect surface.
93
+ /// Gestures from a trackpad.
94
+ ///
95
+ /// A trackpad here is defined as a touch-based pointer device with an
96
+ /// indirect surface (the user operates the screen by touching something that
97
+ /// is not the screen).
98
+ ///
99
+ /// When the user makes zoom, pan, scroll or rotate gestures with a physical
100
+ /// trackpad, supporting platforms dispatch events with kind [trackpad] .
101
+ ///
102
+ /// Events with kind [trackpad] can only have a [PointerChange] of `add` ,
103
+ /// `remove` , and pan-zoom related values.
104
+ ///
105
+ /// Some platforms don't support (or don't fully support) trackpad
106
+ /// gestures, and might convert trackpad gestures into fake pointer events
107
+ /// that simulate dragging. These events typically have kind [touch] or
108
+ /// [mouse] instead of [trackpad] . This includes (but is not limited to) Web,
109
+ /// and iOS when `UIApplicationSupportsIndirectInputEvents` isn't present in
110
+ /// `Info.plist` or returns NO.
111
+ ///
112
+ /// Moving the pointing cursor or clicking with a trackpad typically triggers
113
+ /// [touch] or [mouse] events, but never triggers [trackpad] events.
114
+ ///
115
+ /// See also:
116
+ ///
117
+ /// * [UIApplicationSupportsIndirectInputEvents] (https://developer.apple.com/documentation/bundleresources/information_property_list/uiapplicationsupportsindirectinputevents?language=objc).
65
118
trackpad,
66
119
67
120
/// An unknown pointer device.
0 commit comments