Route system Back through the current navigation owner
This commit is contained in:
parent
b51dced5fe
commit
a268cdd7b8
27 changed files with 196 additions and 77 deletions
|
|
@ -32,14 +32,14 @@ import androidx.tv.material3.Text
|
|||
import org.justinvisser.wolfskin.design.WolfskinTokens.Color as C
|
||||
import org.justinvisser.wolfskin.design.WolfskinTokens.Layout as L
|
||||
|
||||
/** Screens and the shell interpret the same Android directional and activation keys. */
|
||||
/** Native Back belongs to the Activity dispatcher; Escape remains the local Back shortcut. */
|
||||
fun readShellKey(event: KeyEvent): ShellKey? = when (event.key) {
|
||||
Key.DirectionUp -> ShellKey.Up
|
||||
Key.DirectionDown -> ShellKey.Down
|
||||
Key.DirectionLeft -> ShellKey.Left
|
||||
Key.DirectionRight -> ShellKey.Right
|
||||
Key.DirectionCenter, Key.Enter, Key.NumPadEnter -> ShellKey.Ok
|
||||
Key.Back, Key.Escape -> ShellKey.Back
|
||||
Key.Escape -> ShellKey.Back
|
||||
else -> null
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue