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.
Did you know that Windows can detect and use multiple keyboards and mice at the same time? Simply plug in your second mouse or keyboard via a USB port, or connect with Bluetooth. After giving Windows a moment to add the necessary drivers, you can type using either keyboard, or control the cursor with both mice.
If you're using Windows, your OS can detect multiple mouses automatically. You simply plug in your extra mouse via a USB port and Windows will automatically add its drivers. You can then control the cursor with either mouse. A simple addition like this is ideal when you want to mirror your main PC to a TV monitor.
You just need to plug your keyboards via a USB port into your computer one by one. Windows has a feature that allows its users to use multiple output devices simultaneously to enhance the user experience. So, it automatically detects and set up two keyboards when connected via a USB port.
Using Pluralinput Install and launch Pluralinput and click on “Set up a new device option” in the left menu. 2. A list of all the connected mice and keyboards will open up. Simply check the checkbox below each mouse or keyboard that you want to use as Pluralinput and click on the “Apply changes to devices” button.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With