How does keyboard input work?

In 3D WebView, all keyboard input is sent to a webview through the IWebView.HandleKeyboardInput() method (or optionally through IWithKeyDownAndUp on platforms that support it). For example, 3D WebView's demo scenes (like SimpleWebViewDemo) set up the Keyboard prefab to send its output to HandleKeyboardInput(), like this:

// Hook up the on-screen keyboard.
var keyboard = GameObject.FindObjectOfType<Keyboard>();
keyboard.InputReceived += (sender, eventArgs) => {
    webViewPrefab.WebView.HandleKeyboardInput(eventArgs.Value);
};

Similarly, the demo scenes use a helper class named HardwareKeyboardListener to detect input from the hardware keyboard and send it to HandleKeyboardInput, like this:

var hardwareKeyboardListener = HardwareKeyboardListener.Instantiate();
hardwareKeyboardListener.KeyDownReceived += (sender, eventArgs) => {
    webViewPrefab.WebView.HandleKeyboardInput(eventArgs.Value);
};