CGAssociateMouseAndMouseCursorPosition Discovery

We are creating a user space device driver for OS X that moves the cursor using Quartz Events, and we run into a problem when games, especially those that work in windowed mode, cannot correctly capture the mouse pointer (= contain / keep it within its windows). For example, he goes beyond the boundaries of the game window and clicks on inactive applications on the desktop or nearby.

We could fix this if we could only detect when the active application calls CGAssociateMouseAndMouseCursorPosition.

How do you do that? Any ideas are welcome.

+63
core-graphics quartz-graphics mouseevent macos
Jan 11 '13 at 23:40
source share
2 answers

I do not know if this will help you.

There is an option called Focus Follows Mouse

Focus follows the mouse - the mouse pointer will automatically change focus to a new window, if you click on it, instead of clicking on the window to get focus, then click to do something.

http://wineskin.urgesoftware.com/tiki-index.php?page=Manual+4.6+Advanced+-+Options

+1
Jul 26 '13 at 15:19
source share

I wrote several different logical layers of the mouse (for connecting different input devices, etc.). I found that connecting to the OS level WM_INPUT is a sure way to get real-time mouse location information very . There is also a less rigorous solution for simply polling the mouse data you need from one of the most primitive Windows DLLs. They are lightning fast. You can poll the 10 ms timer and never see any performance loss on a modern machine.

-one
Jul 24 '13 at 7:00
source share



All Articles