I am accessing an html webapp within a WebView in an Xbox XAML app. For context, it was previously a hosted webapp, but leaks while playing video content were causing crashes, which prompted me to use a XAML app with a WebView and a MediaElement.
Initially, my <input/>
fields were not showing the keyboard (InputPane) when focused and pressing the 'A/ok' button on the controller/remote. Using the following
window.Windows.UI.ViewManagement.InputPane
.getForCurrentView()
.tryShow();
helped show the keyboard on first key press. With my app hosted in the WebView, I had the same problem, but window.Windows
was not available. The solution seems to be the use the ScriptNotify
event on the WebView, that itselfs calls the (very similar) following code in the C# portion of the code:
Windows.UI.ViewManagement.InputPane.GetForCurrentView().TryShow();
So far so good. Now the problem: when hitting the "B/return" button on the controller/remote, the InputPane leaves, and the <input/>
element is obviously focused since it still shows a blinking text cursor, but the app does not respond to keypresses. I have to press the "B/return" button a second time to regain control on the webapp.
I looked into the InputPane api, and in hacks like focusing the WebView but without success so far.
Any help is greatly appreciated!