Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows: Separating input from 2 Mice

Tags:

c#

io

windows

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.

like image 942
Rich Oliver Avatar asked Jan 19 '12 13:01

Rich Oliver


People also ask

Can you use two separate mice on the same computer?

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.

How do I use two mice on two monitors Windows 10?

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.

How do I use two keyboards separately?

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.

How do you use Pluralinput?

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.


1 Answers

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.

like image 145
Raphael Ayres Avatar answered Oct 10 '22 19:10

Raphael Ayres