Add hand-built on-screen keyboard to the OpenXR menu quad
build / build (push) Successful in 1m45s

MenuOverlay's key grid forwards every press to the game as real input:
non-printable keys (Esc/Enter/Backspace) as an SDLActivity.onNativeKeyDown()/
onNativeKeyUp() pair, and printable keys (letters, Space) as a synthesized
SDL_TEXTINPUT event pushed directly from native code, since the engine's
pump_events() only picks up printable ASCII from that event type, not from
SDL_KEYDOWN. Confirmed on-device, including that Space now correctly skips
the intro cutscene alongside Esc/Enter.
This commit is contained in:
ml
2026-08-05 08:11:16 +02:00
parent 1be0bebda2
commit 2d8fb49bf5
4 changed files with 269 additions and 31 deletions
+19 -9
View File
@@ -140,15 +140,25 @@ can be sideloaded onto any Android-based VR headset with OpenXR support
vendor's store. The game's own rendering is unchanged (still a flat, 2D
render, no stereo 3D scene), but instead of running as a Home-hosted 2D
panel it's now shown as a single head-tracked quad floating in front of
the viewer, with a separate menu quad (currently just one "Keyboard"
button - the actual on-screen keyboard behind it is still ongoing work)
toggled by a controller button and driven by a laser-pointer-style aim
ray from each hand (`android/app/src/main/cpp/xr_input.c`) - point and
pull the trigger to interact with the menu, same as the game's own
Bluetooth mouse/keyboard input otherwise works unchanged. The laser
pointer/cursor is currently only visible while actually aiming at the
game or menu quad respectively - there's no visual feedback yet while
aiming at empty space between them. (Only tested on Meta Quest so far -
the viewer, with a separate menu quad toggled by a controller button and
driven by a laser-pointer-style aim ray from each hand
(`android/app/src/main/cpp/xr_input.c`) - point and pull the trigger to
interact with it, same as the game's own Bluetooth mouse/keyboard input
otherwise works unchanged. The menu's "Keyboard" button swaps to a
hand-built on-screen key grid (`MenuOverlay.java` - there's no system IME
to borrow once immersive) that forwards each key press straight to the
game as real input - non-printable keys (Esc/Enter/Backspace) as a
`SDLActivity.onNativeKeyDown()`/`onNativeKeyUp()` pair, the same one a
physical Bluetooth keyboard's presses already go through, and printable
keys (letters, Space) via a synthesized `SDL_TEXTINPUT` event pushed
directly from native code (`questshock_native.c`) - meant as a general
stand-in for keyboard-driven functionality that isn't (yet, or ever)
mapped onto the controllers, not just a future config screen's text
entry. The laser
pointer/cursor is currently only visible while
actually aiming at the game or menu quad respectively - there's no visual
feedback yet while aiming at empty space between them. (Only tested on
Meta Quest so far -
the steps below use Quest-specific tool names where relevant, but the
same `adb install` flow applies to any Android headset with USB
debugging enabled.)