Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question 2 players, 2 keyboards, same key binds. Is it supported? How do I do it?

Discussion in 'Input System' started by PowerJake, Jul 12, 2023.

  1. PowerJake

    PowerJake

    Joined:
    Nov 15, 2019
    Posts:
    61
    I'm working on a local co-op game with a control scheme that works best on a keyboard. How can I get unity to recognize two keyboards as separate devices? Both players should be able to move their character with WASD. Currently, InputSystem.devices only contains one keyboard while I have two connected.


    Edit: I should add that I have looked at this thread. https://forum.unity.com/threads/multiple-keyboards.753473/ The answer provided doesn't work as it assumes InputSystem.devices to include all keyboards, when it does not.

    Using unity 2021.3.19 and input system 1.5.0
     
    Last edited: Jul 12, 2023
  2. PowerJake

    PowerJake

    Joined:
    Nov 15, 2019
    Posts:
    61
    It seems the solution (on windows) is to write a .dll plugin in c++ that catches rawinput messages from the OS and use that to manage input rather than either of unity's input solutions. My plugin isn't done yet and doesn't quite work with unity, but it is getting somewhere.