Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop. Disable default reaction on secondary clicks when we click on Button, move Slider, etc #832

Closed
igordmn opened this issue Jun 29, 2021 · 2 comments
Assignees
Labels
desktop input Touch, mouse, keyboard input related p:high High priority
Milestone

Comments

@igordmn
Copy link
Collaborator

igordmn commented Jun 29, 2021

Currently we can click on a Button with the right mouse Button and it will consume it.

Desktop platforms don't usually send clicks when we we click not with the left mouse button.

@igordmn igordmn added input Touch, mouse, keyboard input related desktop labels Jun 29, 2021
@igordmn igordmn added the p:high High priority label Nov 2, 2021
@igordmn igordmn added this to the 1.0 milestone Nov 2, 2021
@olonho
Copy link
Contributor

olonho commented Nov 2, 2021

We can also just right click on button and get onClicked callback.

igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Nov 19, 2021
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
@igordmn
Copy link
Collaborator Author

igordmn commented Nov 19, 2021

Should be fixed in 1.0.0-beta6-dev474

@igordmn igordmn closed this as completed Nov 19, 2021
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 14, 2022
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 18, 2022
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 20, 2022
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 20, 2022
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Feb 18, 2022
… move Slider, etc

This CL disable all non-left button 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. If we would 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 high-level API.
- high-level clickable, draggable, toggleable, which use awaitFirstDown under the hood
- high level mouseClickable, which provides info about which button was pressed. It doesn't use awaitFirstDown under the hood.

Fixes JetBrains/compose-multiplatform#832
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 28, 2022
…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
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Mar 30, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Apr 18, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Jun 2, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Jun 27, 2022
…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
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Aug 18, 2022
…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
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Aug 18, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Oct 26, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Nov 16, 2022
…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
eymar pushed a commit to JetBrains/compose-multiplatform-core that referenced this issue Jan 13, 2023
…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
MatkovIvan pushed a commit to MatkovIvan/compose-multiplatform that referenced this issue May 10, 2023
…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#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
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Nov 15, 2023
…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
igordmn added a commit to JetBrains/compose-multiplatform-core that referenced this issue Nov 16, 2023
…y mouse clicks when we click on Button, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop input Touch, mouse, keyboard input related p:high High priority
Projects
None yet
Development

No branches or pull requests

3 participants