0

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!

vgrafe
  • 1,300
  • 1
  • 12
  • 13
  • Could you please provide your XBox windows 10 OS version and UWP app version? By testing on build 15063, area will show the keyboard by default, why and how you need show it manually? – Sunteen Wu Aug 18 '17 at 02:34
  • @SunteenWu-MSFT the OS version is 10.0.15063.4102 - I need to show the keyboard manually since without that line of code, showing the keyboard would need to press the enter key two times. – vgrafe Aug 28 '17 at 20:40

0 Answers0