问题
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?
回答1:
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://docs.microsoft.com/en-us/microsoft-edge/dev-guide/dom/gamepad-api
来源:https://stackoverflow.com/questions/38651954/disable-pointer-mode-for-webview-in-xbox-uwp