Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global mouse events

Hallo,

I am trying to keep track of the mouse position and also its delta position. Is there any nicer way of doing this then implementing all the mouse events for all my forms in my window?

The problem with using the MouseMove event is that as soon as the mouse moves outside of the form it stops working properly. Implementing the mouseEnter, mouseLeave improves it somewhat, but it does still not feel perfect. Any ideas?

Regards,

like image 277
Ole Avatar asked May 24 '11 17:05

Ole


1 Answers

You have to handle lower level windows events.

Check out this example: http://www.codeproject.com/KB/cs/globalhook.aspx

like image 107
jvenema Avatar answered Nov 17 '22 16:11

jvenema