mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 04:55:44 +00:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user