Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Updating from 1.0.2 to a more recent version, keyboard stops working outside menus

Discussion in 'Input System' started by JagGentlemann, Feb 3, 2024.

  1. JagGentlemann


    Feb 10, 2016
    Hi, I'm using the 1.0.2 Input System and it works perfectly, I've even made a remapping menu. I'm also using Unity 2020.3.8, so it's high time I update. The issue is that when I update Unity, the Input System also updates, and when doing that, the keyboard stops working... but only in gameplay for some reason.

    I have 2 Action Maps: one for menus and another one for the gameplay.

    The one for menus work fine for the keyboard and gamepad, but when I enter the gameplay, only the gamepad works, but not the keyboard. I use the following line of code to assign the Keyboard:

    Code (CSharp):
    1. controlScheme = "Keyboard";
    2. playerInput.SwitchCurrentControlScheme(controlScheme);
    and this one for the controller:

    Code (CSharp):
    1. controlScheme = "Gamepad";
    2. var gamepad = Gamepad.all[deviceIndex];
    3. playerInput.SwitchCurrentControlScheme(controlScheme, gamepad);
    When a character is spawned, I assign the buttons with ApplyBindingOverride. I really doubt this is giving me the issue because I had this problem before doing the remapping menu and code.

    Unity can clearly see the binding. Even adding the binding in the editor itself mid-game does nothing. I tried different versions of hte Input System, but even the next to 1.0.2 breaks it.

    Any ideas what could be the issue? Ask for more info if this isn't enough. I really want to update to remove the splash screen, considering the new policies, so I think the sooner I update, the better.

    Edit: The way to fix this is to do nothing when assigning the Keyboard, because if not, it assings a controller. I don't see how that makes sense, but it works.
    Last edited: Feb 20, 2024