Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
219 views
in Technique[技术] by (71.8m points)

c# - Avalonia UI mouse cursor not hiding correctly on Raspberry Pi

I've recently been trying to develop a small GUI application for my raspberry using avalonia ui. The application should run in full-screen mode and hide the cursor when it is running in full screen. For that I've set up a timer that starts as soon as the mouse stops moving.

Running the application in Windows, everything works as expected. Three seconds after the mouse stops moving, it hides itself.

On the raspberry the application starts in full screen, but the cursor doesn't hide, it just flickers. At least as long as the mouse wasn't moved since starting the application. By manually moving the mouse after the application started everything works fine again.

The main issue I'm facing is, that the app starts itself when the raspberry has started up and it's unpractical to have someone that needs to move the mouse in order for the cursor to hide.

Does anyone have a possible solution?

question from:https://stackoverflow.com/questions/65916538/avalonia-ui-mouse-cursor-not-hiding-correctly-on-raspberry-pi

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

So after a bit trial and error I've managed to create a simple workaround on how to fix it.

By installing the xdotool package for on the rapsberry you can move the mose from commandline.

With this I've set up a script that starts the program and after a delay of 5 seconds moves the mouse.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...