问题
We have an app that hides the desktop icons when the keyboard/mouse are idle for longer than 15 seconds. When the user starts using either of these devices again, we would like to draw their attention to the location of their mouse, much akin to how the CTRL key can be enabled to circle the mouse in Windows.
Are there any similar functions or suggestions I could use to perform such a task? I find working with the mouse in a global fashion (Anywhere on the desktop, not just on our app) very difficult.
Thanks very much for the suggestions!
回答1:
1) use a timer with 15 seconds interval;
2) save the current mouse location on screen: Getting mouse position in c#
3) when timer reached 15 seconds, check mouse location again. if it is changed, update current mouse location. if it is unchanged, draw something on screen at the mouse location (and you need clean it too): How do I draw graphics in C# without a form
It is not the best choice, but if the mouse is moved during the 15 seconds, it is unlikely it will back to its original location in 15 seconds.
来源:https://stackoverflow.com/questions/13729092/how-to-draw-attention-to-the-current-mouse-location