2

Is there a way to disable pointer mode for WebView in an Xbox UWP app? I cannot use the RequiresPointer property since WebView is extended from FrameworkElement and not from Control.

This is my sample XAML:

  <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <WebView Source="http://stackoverflow.com/" Height="300" Width="500" />
  </Grid>

Please find the pointer marked in the image below.

I have provided

 RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;

in App.xaml.cs and RequiresPointer = RequiresPointer.Never; at Page level.

How can I avoid the pointer and use controller buttons for scrolling?

enter image description here

Bells
  • 1,465
  • 1
  • 19
  • 30
  • 1
    You want to disable pointer mode of `WebView`? You can refer to [WebView Events table](https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.aspx?f=255&MSPPError=-2147217396#events), `WebView` doesn’t support most of the user input events inherited from UIElement, such as KeyDown, KeyUp, and PointerPressed by design, in other words, pointer mode of `WebView` is already disabled, I'm confused with what you are asking for. – Grace Feng Aug 01 '16 at 02:20
  • Hey, bro. Did you find the right way? – Vincent Jul 16 '19 at 08:35

1 Answers1

3

The contents of the WebView needs to say that it supports gamepad control rather than defaulting to mouse emulation (docs):
navigator.gamepadInputEmulation = "gamepad";

And then you need to use the Gamepad API:
https://learn.microsoft.com/en-us/microsoft-edge/dev-guide/dom/gamepad-api

vitaminj
  • 31
  • 3