Search Unity

How to detect the keyboard and the mouse "as the same input device"?

Discussion in 'Editor & General Support' started by gillemp, Apr 22, 2020.

  1. gillemp

    gillemp

    Joined:
    Nov 23, 2015
    Posts:
    81
    Hello,

    I'm trying to use the PlayerInputManager of the new InputSystem (preview 7) and my keyboard and mouse are being detected as separate devices. I'm not saying that it is wrong, but it is not useful at all and I would like to know how to fix it.

    As shown in this video, the PlayerInputManager has the ability of Instantiating new players when they press a button of their controller. This is almost exactly what I need, but it is not perfect.

    All works fine using controllers but if someone wants to join using the keyboard/mouse, "they won't be able".

    When a key is pressed in the keyboard, a player joins, and when the mouse is used, another player joins (despite the fact that in that game youn need both to control a character and neither one of the spawned characters would be playable).

    So my question is: how can I configure the InputSystem so that only one player joins when either a keyboard or mouse is used and it reads the input from both devices?

    Maybe it is simply a missing feature, but I think that it would be nice if you could achieve what I want because a lot of times the keyboard is used alongside a mouse.

    Thanks in advance!
     
  2. gillemp

    gillemp

    Joined:
    Nov 23, 2015
    Posts:
    81