Rich Oliver
Rich Oliver

Reputation: 6109

Windows: Separating input from 2 Mice

Initially, I want to use 2 mice for an application with separate pointers and interaction between the 2 mice(e.g. selecting a rectangular area). Later I might want to have a second pointer available generally in windows. I thought this might be possible by simulating a stylus pen with the second mouse.

My main question though is: Am I right to use a system hook as opposed to RawInput, DirectInput or InputX?

If using a system hook I presume I need to use WH_MOUSE_LL rather than WH_MOUSE even if the application is running on one thread? My preferred language is C#, but again I presume that using DLL imports means I can do anything that's possible in C++ or C.

Upvotes: 8

Views: 810

Answers (1)

Raphael Ayres
Raphael Ayres

Reputation: 894

Using system hook is the way to go in WINDOWS. You can use C# with InteropServices and the apropriate COM+ objects, altough creating a C++ class and wrapping it would be a better approach. I've done it myself with keyboard events. I could LOG all keyboards typing... And yes, you have to use WH_MOUSE_LL.

Upvotes: 1

Related Questions