67

We're making a user-space device driver for OS X that moves the cursor using Quartz Events, and we ran into a problem when games — especially ones that run in a windowed mode — can't properly capture the mouse pointer (= contain/keep it within the boundaries of their windows). For example, it would go outside the game window and click on the desktop or nearby inactive applications.

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

How would you do this? Any ideas are appreciated.

1
  • there's no way to present as a HID driver/device rather than posting your own events? That might be an approach...
    – nielsbot
    Mar 20, 2013 at 18:08

2 Answers 2

1

I dont know if this can help you

There is an option called Focus Follows Mouse

Focus Follows Mouse - The Mouse pointer will grab automatically change focus to a new window inisde this one app if you mouse over it, instead of having to click a window to get focus, then clicking to do something.

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

0

I have written a few different mouse logical layers (for bridging different input devices, etc.). I have found that hooking into the OS level WM_INPUT event is a sure way of getting very real-time mouse position information. There is also a less rigorous solution of just polling the mouse data you need from one of Windows' very primitive DLLs. They are lightning fast. You could poll on a 10ms timer and never see performance loss on a modern machine.

1
  • I don't understand how this applies to my problem in OS X.
    – Dae
    Jul 25, 2013 at 14:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.