Cannot hide mouse cursor in Xbox One app targeting 10.0.14393.0
-
I have a simple app targeting UWP containing a WebView, that I'm testing on the Xbox One. One thing which is bothering me and which I cannot seem to get rid of is the mouse cursor. That means that users cannot use the gamepad to do directional navigation between UI elements. On a regular XAML app, you are supposed to disable mouse mode at startup by calling
Application.Current.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested
, as detailed in https://blogs.windows.com/buildingapps/2016/09/09/tailoring-your-app-for-xbox-and-the-tv-app-dev-on-xbox-series/ (section 1. Optimize for the Gamepad) . UnfortunatelyApplication.Current
doesn't seem to be available on Qt apps (throws an exception withE_NOINTERFACE
).Is this a known issue with Qt on the Xbox One with the Anniversary Update?
P.S.: looking at the code for the
AppContainer
constructor, it seems anApplication
object is indeed created (but not saved), but for some reason it is not accessible through theApplication.Current
property. -
Hi @Besidge and welcome!
This is a pretty hard one, as I'm not aware of many people working on XBone.
So lets ping @mkalinow if he happens to read here occasionally.Otherwise I would ask this on the Qt Interest mailing list: http://lists.qt-project.org/mailman/listinfo/interest
-
I did a test subsequently, by copying the whole
WinMain
andAppContainer
code to my project and tried to query theIApplication
interface to anIApplication2
interface, and that still returnedE_NOINTERFACE
, so not really sure what could be done from the Qt side, other than instantiating the Application as a full-fledged XAML application. -
I did a test subsequently, by copying the whole
WinMain
andAppContainer
code to my project and tried to query theIApplication
interface to anIApplication2
interface, and that still returnedE_NOINTERFACE
, so not really sure what could be done from the Qt side, other than instantiating the Application as a full-fledged XAML application.@Besidge @mkalinow my contact at Microsoft looked at the code and doesn't understand why a XAML Application object is being created, instead of the lower level
Windows::ApplicationModel::Core::IFrameworkView
. Granted, neither him nor me are well-versed enough in Qt to understand why this decision was made. Using a XAML application will put the app automatically in mouse mode on the XB1, which is rarely wanted. -
@Besidge, @mkalinow: I was able to reproduce this problem with a short sample project built from a VS template. The only way I was able to disable mouse mode (by accessing the
RequiresPointerMode
property) was to create a real::Windows::UI::Xaml::Application
-derived class, instead of resorting toXaml::IApplicationFactory
like Qt currently does. It seems thatXaml::IApplicationFactory
creates an older style object which doesn't implement theIApplication2
interface.