This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add engine support for scrollwheel events #7494
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b0c6a9a
Add PoC scrollwheel support
stuartmorgan-g 77ed463
Rework to better allow for future gesture-based scrolling
stuartmorgan-g aa2d55f
Fix Android PointerData construction (speculative)
stuartmorgan-g 323c177
Merge commit '57fd394e59b81262b6c74c97c15d159befd6a3a7' into scrollwheel
stuartmorgan-g 0e78fb8
Merge commit '7112b72cc229e05d36716c3d7739885d3ffa72e6' into scrollwheel
stuartmorgan-g d1e792b
Merge commit '5dee035ee2d9a47123b72c0ac8d14b60e5c9fee1' into scrollwheel
stuartmorgan-g 346a77c
Rename gesture to signal
stuartmorgan-g 2628378
Remove the use of signal as a kind
stuartmorgan-g 9fe63ca
Merge commit 'f37b09a11b' into scrollwheel
stuartmorgan-g 2cacf96
Merge commit 'f7306394e303a210a9971acb60f9ba11d7c64ec8' into scrollwheel
stuartmorgan-g edcbe4a
Update stub_ui
stuartmorgan-g e61d270
Merge branch 'master' into scrollwheel
stuartmorgan-g File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,13 +54,26 @@ enum PointerDeviceKind { | |
unknown | ||
} | ||
|
||
/// The kind of [PointerDeviceKind.signal]. | ||
enum PointerSignalKind { | ||
/// The event is not associated with a pointer signal. | ||
none, | ||
|
||
/// A pointer-generated scroll (e.g., mouse wheel or trackpad scroll). | ||
scroll, | ||
|
||
/// An unknown pointer signal kind. | ||
unknown | ||
} | ||
|
||
/// Information about the state of a pointer. | ||
class PointerData { | ||
/// Creates an object that represents the state of a pointer. | ||
const PointerData({ | ||
this.timeStamp: Duration.zero, | ||
this.change: PointerChange.cancel, | ||
this.kind: PointerDeviceKind.touch, | ||
this.signalKind, | ||
this.device: 0, | ||
this.physicalX: 0.0, | ||
this.physicalY: 0.0, | ||
|
@@ -79,6 +92,8 @@ class PointerData { | |
this.orientation: 0.0, | ||
this.tilt: 0.0, | ||
this.platformData: 0, | ||
this.scrollDeltaX: 0.0, | ||
this.scrollDeltaY: 0.0, | ||
}); | ||
|
||
/// Time of event dispatch, relative to an arbitrary timeline. | ||
|
@@ -90,6 +105,9 @@ class PointerData { | |
/// The kind of input device for which the event was generated. | ||
final PointerDeviceKind kind; | ||
|
||
/// The kind of signal for a pointer signal event. | ||
final PointerSignalKind signalKind; | ||
|
||
/// Unique identifier for the pointing device, reused across interactions. | ||
final int device; | ||
|
||
|
@@ -203,6 +221,16 @@ class PointerData { | |
/// Opaque platform-specific data associated with the event. | ||
final int platformData; | ||
|
||
/// For events with signalKind of PointerSignalKind.scroll: | ||
/// | ||
/// The amount to scroll in the x direction, in physical pixels. | ||
final double scrollDeltaX; | ||
|
||
/// For events with signalKind of PointerSignalKind.scroll: | ||
/// | ||
/// The amount to scroll in the y direction, in physical pixels. | ||
final double scrollDeltaY; | ||
|
||
@override | ||
String toString() => '$runtimeType(x: $physicalX, y: $physicalY)'; | ||
|
||
|
@@ -212,6 +240,7 @@ class PointerData { | |
'timeStamp: $timeStamp, ' | ||
'change: $change, ' | ||
'kind: $kind, ' | ||
'signalKind: $signalKind, ' | ||
'device: $device, ' | ||
'physicalX: $physicalX, ' | ||
'physicalY: $physicalY, ' | ||
|
@@ -228,7 +257,9 @@ class PointerData { | |
'radiusMax: $radiusMax, ' | ||
'orientation: $orientation, ' | ||
'tilt: $tilt, ' | ||
'platformData: $platformData' | ||
'platformData: $platformData, ' | ||
'scrollDeltaX: $scrollDeltaX, ' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is physicalX set to when scrollDeltaX is non null / nonzero? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm, i see, that's where the point is. Will any future signals involve more than two linear dimensions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would expect swipe to use these fields; pinch zoom and rotate would need different fields. |
||
'scrollDeltaY: $scrollDeltaY' | ||
')'; | ||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.