Wire XR keyboard text into the session input queue (#3631)

Initialize KeyboardHost with the updated key and text callbacks. Keep XR physical-key routing and use the regular ordered compositor queue for text.
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-12-03 09:54:26 -05:00
1 parent f9eeef44ed
commit 8b3cc7eb15
1 file changed
+8 -4
@@ -1605,10 +1605,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
/** The VR keyboard's keys go straight to the game, past the menu and pad handling a real key passes through. */
private val xrKeys by lazy {
com.droiddeck.launcher.input.KeyboardHost(this) { event ->
CompositorHost.isStarted && (event.action != KeyEvent.ACTION_DOWN || event.repeatCount == 0) &&
com.droiddeck.launcher.input.GuestKeys.send(event) { code, pressed -> sendGuestKey(code, pressed, 16) }
}
KeyboardHost(
this,
sendKeyEvent = { event ->
CompositorHost.isStarted && (event.action != KeyEvent.ACTION_DOWN || event.repeatCount == 0) &&
com.droiddeck.launcher.input.GuestKeys.send(event) { code, pressed -> sendGuestKey(code, pressed, 16) }
},
sendText = { text -> if (CompositorHost.isStarted) WaylandCompositor.textInputCommit(text) },
)
}
@androidx.compose.runtime.Composable