Disable pointer mode for webview in Xbox UWP

感情迁移 提交于 2021-01-29 04:23:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!