Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

New Input System and Valve Knuckles

Discussion in 'Input System' started by RedRiverStudio, Mar 5, 2021.

  1. RedRiverStudio


    Sep 8, 2014

    Am I doing this wrong?

    I had my entire game based around Rewired which has worked decently enough over the years. I now have to add Valve Index support, and Rewired does not have any (last I checked) support for XR controllers. I had asked for some custom controller files, and Rewired did not disappoint, but trying to add my own has been a nightmare and I would rather let Unity manage XR devices with all of their new fancy Input and XR systems in place. Half of Rewired's toil was to combat updates from Unity, so lets just go to the source, right?

    I see there is a new Input system. I download and start mapping action. Most things work as advertised however no mention on Valve Index in the presets (Wand,Touch,WMR, etc all seem to be there) So no matter what I do, I cant get the new Input System to see an Index at all, not even the buttons or hats. Googling shows that the OLD system has it mapped to every axis, down to the fingers. So the old system supports knuckles, the new system does not? I go to the old system in the editor and its grayed out because I have the new system package installed.

    I then discover that XR.input devices has universal functions. I get Trigger working, I get Grip working, things are looking up, I just have to mix my universal XR inputs with my new InputSystem inputs. I now have a multiverse input system. I continue to manually map the knuckles inputs, but LO, it wont see secondary buttons, it registers grip as the same button as button 1, The buttons and axis are all scattered and doubled up.

    So let me get this perfectly straight:
    • Old Unity Input system has full Index mapping
    • New Unity Input System has no Index mapping
    • Unity XR system has partial Index mapping
    • Old Unity Input system cant be used with New Unity Input System
    • New Old Unity XR system is deprecated and going to disappear soon.
    • SteamVR has full Knuckles support but tries to take over your project and life the second you run it.

    What in the steaming hell is going on?
  2. Lurking-Ninja


    Jan 20, 2015
    In the Player settings you can change it to use both at the same time if you want. Although I have no idea if it is supported on VR/XR/AR/whateveR stuff, I don't touch any of those.

    In theory here is the list of supported devices:
    But AFAIK VR support stuff is in the proper device-related package, not in the base InputSystem package.

    You also can create new devices if you can't wait while Unity and the different teams are adding common devices to the supported list. There be dragons. Also don't know if this solution is good enough, since I don't use fringe devices, the common ones I use are already present in the system.
  3. RedRiverStudio


    Sep 8, 2014
    @Lurking-Ninja thanks so much for your reality check. I did eventually come up with a class that would combine XR with InputSystem. I did try using both new and old input systems concurrently, but the old one reads the knuckles just as effectively as XR does, so I abandoned it.

    The old XR system has just enough support in it to get the job done. One of the struggles I was facing was that the Knuckles system is bound through Steam, and that default binding was all over the show. Once I set the buttons to primary and secondary, inputs stopped overlapping. For anybody who gets stuck trying to talk to the knuckles, check the binding WITHIN Steam first.

    Fortunately I dont need individual finger axis, so I can rely on the default XR settings.
    ChiranjivBudheHM likes this.
  4. ChiranjivBudheHM


    Feb 12, 2019
    For anyone stuck with the same issue, and stumble upon this post. I got Valve Knuckles to work with Unity's new input system:

    1) 1st problem was that the grip and the secondary button (aka A for Index) were overlapping, changing the bindings within the Steam VR, thanks to RedRiverStudio for pointing that out fixed this issue, so if you are pressing A on Index the Grip was returning true, after changing the A button binding from "Left Grip Button" to "Left A Button" fixed the overlapping issue,

    2) After fixing the overlapping issue for the A button, I wasn't able to read the value by using SecondaryButton [Left/Right hand XR Controller ], even though the XR Input Debugger was returning the correct value, for this to work I pressed the listen button on the bindings and it provided me "alternate [Left/Right hand XR Controller]" which worked for me.

    3) 3rd problem I wasn't able to read the value from PrimaryButton (aka B for index), for this to work you have to set the path of the binding to "Primary [left/right-hand XR controller]", setting it to PrimaryButton didn't work for me.

    I am on 2019.4.30f1, XR interaction toolkit 1.10.0 preview 7, input system 1.2.0, using the deprecated XR settings
    Last edited: Dec 14, 2021