0

I have a XAML/C# UWP app running a WebView for hosted content. With the legacy version of the app (a .jsproj type), I can run it on Windows 10/11 and the page within receives input from the controller. In my new version, the page within seems blind to any controller input and I am unsure why. JavaScript on the hosted portion of the app has the following:

window.navigator.gamepadInputEmulation = 'keyboard';

and I have also tried setting it to:

window.navigator.gamepadInputEmulation = 'gamepad';

But to no avail. This new version using C#/XAML doesn't propagate Xbox Controller input to the WebView. However, it does get input from the keyboard.

Controller input works fine though if I run this version on an Xbox One.

Joshua Dannemann
  • 2,003
  • 1
  • 14
  • 34
  • Well, since it's about UWP JS, you could report this behavior on Feedback Hub – Roy Li - MSFT Feb 07 '22 at 07:39
  • @RoyLi-MSFT Thanks. I've reported it but was hoping there might be a workaround since something very similar was seen happening when Windows 11 was in preview. If not, then guess I'll just have to deal with it, but I feel sorry for any developer who does need the controller working for their app in Windows 11. For me, it is just a minor inconvenience. Here is a link to a substantially similar question: https://stackoverflow.com/questions/69115995/how-to-detect-xbox-controller-key-press-events-in-windows-11-in-winjs-uwp-app – Joshua Dannemann Feb 07 '22 at 17:36
  • @JoshuaDannemann Were you able to find a fix/workaround for this issue? – Aivan Monceller Oct 26 '22 at 02:44
  • 1
    @AivanMonceller I have not revisited the issue in awhile, but when I find a solution, I will remember to post it here. – Joshua Dannemann Nov 17 '22 at 20:25

0 Answers0