microsoft-ui-xaml
microsoft-ui-xaml copied to clipboard
WinUI Ignores Hide Pointer While Typing Option
Describe the bug
Windows has an option in Settings -> Bluetooth & devices -> Mouse -> Additional mouse settings -> Pointer Options called 'Hide pointer while typing' which is on by default and automatically hides the mouse cursor while you're typing. This is quite useful as sometimes you might click into a text field and start typing and some of the text gets covered by the mouse cursor, so you might need to move the cursor so you can see what you're typing. It isn't a big deal to have to do that, but it can get annoying having to do it a lot. Currently, WPF, Windows Forms, and the Windows common controls already support this feature by default.
Steps to reproduce the bug
- Create a WinUI 2 or 3 application
- Add a TextBox to the UI
- Positon the mouse cursor so that it is over the window with the TextBox
- Run the app and type into the TextBox
- The cursor does not dissapear, even if it is covering the TextBox
Expected behavior
The cursor should dissapear if it is over the window when typing into the TextBox, as it does when typing into a WPF, Windows Forms or Windows Common Controls TextBox.
Screenshots
This is the option which I am referring to:
NuGet package version
WinUI 3 - Windows App SDK 1.4.4: 1.4.231219000
Windows version
Windows 11 (22H2): Build 22621
Additional context
Happens in both WinUI 2 and 3. Also happens on Windows 10 22H2 (Build 19045) and probably all other versions of Windows 11 and 10, but haven't tested other versions.
Don't really remember this feature. It seems old tech would do this properly, but many of todays' new app does not, like chrome/Edge/all the electron-based app. But interestingly, the new terminal does it while old conhost
does not. Would like to know how this is implemented.