如何禁用Xbox One的指针模式(C#,UWP) [英] How Can I Disable Pointer Mode For Xbox One (C#, UWP)
问题描述
我想知道如何在UWP应用程序上禁用指针模式.我已经设置了XYFocusKeyboardNavigation,将xbox一个控制器插入PC时,一切运行正常.每当我调试控制台时,我都有一个指针而不是典型的xbox控件.我试图通过添加以下命令来禁用它,但是没有任何效果,请帮忙:
I was wondering how I could disable pointer mode on a UWP application. I already have XYFocusKeyboardNavigation set up and everything works perfectly when I plug my xbox one controller into my PC. Whenever I debug to my console I have a pointer instead of typical xbox controls. I have tried to disable it by adding the following commands but nothing worked, please help:
RequiresPointer="Never" //At Page Level
this.RequiresPointer = RequiresPointer.Never; //On Load
RequiresPointerMode = "WhenRequested" //In App.xaml
this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested; //tried on load but requirespointermode does not exist
Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested; //tried on load but got Error: System.NotSupportedException: 'Specified method is not supported.'
推荐答案
每当我调试控制台时,我都有一个指针而不是典型的xbox控件.我试图通过添加以下命令来禁用它,但是没有任何效果,请帮助:
this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested; //tried on load but requirespointermode does not exist
Whenever I debug to my console I have a pointer instead of typical xbox controls. I have tried to disable it by adding the following commands but nothing worked, please help:
this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested; //tried on load but requirespointermode does not exist
要关闭鼠标模式,请将以下内容添加到您的应用的构造函数中
To turn off mouse mode, add the following to the constructor for your app
App.xaml.cs
public App()
{
this.InitializeComponent();
this.RequiresPointerMode = Windows.UI.Xaml.ApplicationRequiresPointerMode.WhenRequested;
this.Suspending += OnSuspending;
}
注意:
如果您正在编写C ++/DirectX应用程序,则无需执行任何操作.鼠标模式仅适用于HTML和XAML应用程序.
If you are writing a C++/DirectX app, there's nothing to do. Mouse mode only applies to HTML and XAML applications.
For more details you could refer to How to disable mouse mode.
这篇关于如何禁用Xbox One的指针模式(C#,UWP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!