在 Xbox UWP 中禁用 webview 的指针模式 [英] Disable pointer mode for webview in Xbox UWP
问题描述
有没有办法在 Xbox UWP 应用程序中禁用 WebView
的指针模式?我无法使用 RequiresPointer
属性,因为 WebView
是从 FrameworkElement
而不是从 Control
扩展的.
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
.
这是我的示例 XAML:
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.
我已经提供
RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
在页面级别的 App.xaml.cs
和 RequiresPointer = RequiresPointer.Never;
中.
in App.xaml.cs
and RequiresPointer = RequiresPointer.Never;
at Page level.
如何避开指针并使用控制器按钮进行滚动?
How can I avoid the pointer and use controller buttons for scrolling?
推荐答案
WebView 的内容需要说支持游戏手柄控制而不是默认鼠标模拟(文档):navigator.gamepadInputEmulation = "gamepad";
The contents of the WebView needs to say that it supports gamepad control rather than defaulting to mouse emulation (docs):
navigator.gamepadInputEmulation = "gamepad";
然后你需要使用游戏手柄 API:
https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/dom/gamepad-api
And then you need to use the Gamepad API:
https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/dom/gamepad-api
这篇关于在 Xbox UWP 中禁用 webview 的指针模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!