Walkthrough 4: 3D Virtual Keyboard Integration
This tutorial explains how to automatically spawn and position a 3D VR virtual keyboard when a player clicks a web search or text field.
🎯 Objective
Automatically show a virtual keyboard widget when the user focuses an input box in the browser, and send typed characters to the active input.
🛠️ Step 1: Bind Focus State Delegate
In your Player Pawn or Screen Actor Blueprint:
text
[ QuestWebViewComponent ] ──► ( Event OnTextInputFocusChanged )
├── WebView: UQuestWebViewComponent*
└── bFocused: Boolean- Drag out
bFocused:- If
True: Spawn or setWBP_VirtualKeyboardvisibility to Visible, positioned in front of the active screen. - If
False: Hide the keyboard widget.
- If
🛠️ Step 2: Wire Keyboard Buttons
Inside your WBP_VirtualKeyboard widget:
- For standard letter/number buttons (
A-Z,0-9, symbols):- On Button Click $\to$ call
ActiveWebView->SendText(Character).
- On Button Click $\to$ call
- For special control buttons:
- Backspace: Call
ActiveWebView->SendKey(EQuestWebViewKey::Backspace). - Enter: Call
ActiveWebView->SendKey(EQuestWebViewKey::Enter). - Tab: Call
ActiveWebView->SendKey(EQuestWebViewKey::Tab).
- Backspace: Call