forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable default reaction on secondary mouse clicks when we click on B…
…utton, move Slider, etc This CL disables all non-left mouse buttons interactions for clickable, draggable, etc. Now we have these event API's: - low-level awaitPointerEvent, which triggers on any event (no matter if it is left or right mouse button) - medium-level awaitFirstDown, which triggers only on left mouse event, and on any touch/stylus/eraser events. If we trigger it on right click too, the user can't distinguish it if it was left or right click, because we don't provide this information in PointerInputChange. In the future we can add something like `filter: (PointerEvent) -> Unit = PrimaryButtonFilter` to awaitFirstDown, and to other high-level API. - high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood Alternative: 1. move PointerButtons from PointerEvent to PointerEventChange 2. filter events on clickable/toggleable/draggable level Fixes JetBrains/compose-multiplatform#832 Change-Id: I32b1cbe283ab0119a49f63288f0cc56baa36d1e5 Test: ./gradlew :compose:foundation:foundation:connectedCheck Test: ./gradlew jvmTest desktopTest -Pandroidx.compose.multiplatformEnabled=true # Conflicts: # compose/ui/ui/src/desktopTest/kotlin/androidx/compose/ui/awt/ComposeWindowTest.kt
- Loading branch information
Showing
4 changed files
with
229 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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 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 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