Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Cannot hide mouse cursor in Xbox One app targeting 10.0.14393.0
Besidge last edited by Besidge
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) . Unfortunately
Application.Currentdoesn't seem to be available on Qt apps (throws an exception with
Is this a known issue with Qt on the Xbox One with the Anniversary Update?
P.S.: looking at the code for the
AppContainerconstructor, it seems an
Applicationobject is indeed created (but not saved), but for some reason it is not accessible through the
tekojo last edited by
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
AppContainercode to my project and tried to query the
IApplicationinterface to an
IApplication2interface, and that still returned
E_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
RequiresPointerModeproperty) was to create a real
::Windows::UI::Xaml::Application-derived class, instead of resorting to
Xaml::IApplicationFactorylike Qt currently does. It seems that
Xaml::IApplicationFactorycreates an older style object which doesn't implement the