Merge pull request 'Fix system Back ownership for titles and Home' (#67) from fm/tv-back-title into fm/tv-round2

This commit is contained in:
justinzeus 2026-11-07 22:36:19 +01:00
commit 1dee89975e
27 changed files with 196 additions and 77 deletions

View file

@ -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
}