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

Make clickable react to NumPadEnter and Spacebar, too #1464

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.compose.ui.input.key.KeyEventType.Companion.KeyDown
import androidx.compose.ui.input.key.KeyEventType.Companion.KeyUp
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.type
import androidx.compose.ui.node.CompositionLocalConsumerModifierNode
import androidx.compose.ui.node.DelegatableNode

// TODO(https://github.com/JetBrains/compose-multiplatform/issues/3341): support isComposeRootInScrollableContainer
Expand All @@ -32,7 +31,7 @@ internal actual fun DelegatableNode
}

internal actual val KeyEvent.isPress: Boolean
get() = type == KeyDown && key == Key.Enter
get() = type == KeyDown && (key == Key.Enter || key == Key.NumPadEnter || key == Key.Spacebar)

internal actual val KeyEvent.isClick: Boolean
get() = type == KeyUp && key == Key.Enter
get() = type == KeyUp && (key == Key.Enter || key == Key.NumPadEnter || key == Key.Spacebar)
Loading