Multiple Mice at one Computer: Unity's new Input System or Rewired?

Hi guys,

I’m looking for help for my local multiplayer game. I have the following setup:

  • Each Player controls an own computer mouse.
  • Therefore, up to 3 mice are connected to one computer.
  • Each Player should have its own mouse cursor.

Therefore, I need a script identifying each computer mouse. I’m not familiar with the new Input System by Unity (Input System | Input System | 1.0.2) and also have not used Rewired (Rewired | Utilities Tools | Unity Asset Store).

My question are:
a) Do you know if the new Input System by Unity does support multiple mice at one local computer? I couldn’t find a hint.
b) Rewired probably does as far as I have understood?
c) What would you recommend to use for my setup? Or any other script? I would probably tend to the new Input System as it seems to be more “close” to Unity, but maybe Rewired is still better?

Thank you very much in advance for any hints!

Cheers,
Alexa

c) i don’t know about those, but could ask if this supports 3 mouses (probably would)

try using the input system, and if you have problems(like i’m having), then consider using Rewired.

however, input system is really complicated, if you find rewired simpler, than use it. I never used Rewired, so i can’t really tell you which one is better. Watch some tutorials about Rewired and the Input System, and choose.

Thanks! I should have written that I already tried this one. It works really good but the one major drawback is that once you start the game in the Unity editor and then pause it, you will loose your mouse cursor when trying to navigate through the Unity windows. I already have contacted the creators, they are aware of this issue.

Thank you for the hint. Yes I also find the system quite complicated. But you nevertheless would recommend to use it in the first place - why? Due to it being “closer” to Unity or is there another reason?

Aside from all that, I would really like to know an answer to “Does the new Input System support multiple mice (not any other controllers would help) and mouse cursors at one computer?”
Maybe someone here in the forum with more experience with the new Input System can answer this question?

I’m also interested in knowing whether the new input system natively supports more than one mouse at once.

I didn’t had success with rewired. At the end I wrote my own thing.

On Win32, there is the Raw Input API.
I’ve posted unity compatible C++ DLL and sample script that supports multiple mice and their conbect/disconnect state. It’s on my PasteBin, here:

You need C++ compiler (yes C++) - to compile the DLL
(replace HWND_DESKTOP with HWND_MESSAGE to get rid of the visible window)

Other than that no support is provided. The code is as is, and it’s nothing complex.

1 Like

I’ve got this working but it seems to suffer from a similar issue as the multi-input asset in the asset store. If you click outside of the game window and back in you lose the devices. Have you encountered that? My application is actually using 2 displays, and that looks like it might have the same issue as you click between displays. Any advice on how to keep it happy?

It does appear that if it happens you can kill and re-init the DLL and it will become responsive again.

I have the unity script use the OnApplicationFocus event to kill and init the DLL and it works great now!

You have to kill(); init(); on OnApplicationFocus! That is, you MUST! Maybe I should update the sample C#. Though, I also have all Unity Input systems disabled in my projects as I go with SIAPI or RawInput myself (or other native APIs)