matzman666 / OpenVR-InputEmulator

An OpenVR driver that allows to create virtual controllers, emulate controller input, manipulate poses of existing controllers and remap buttons. A client-side library that communicates with the driver via shared-memory is also included.
GNU General Public License v3.0
718 stars 138 forks source link

Is it possible to send input to real device ? #120

Open levantail opened 6 years ago

levantail commented 6 years ago

I have HTC Vive pro, and i would like to know, is it possible to send input to real controller using OpenVR-InputEmulator? (in other words just simulate button press); I have already read README file but maybe i miss something.

best regards

mmorselli commented 6 years ago

Yes, via the provided client_commandline.exe. I wrote a shell for that

https://github.com/mmorselli/Joy2OpenVR

If you need only the command line for a specific action, let me know

levantail commented 6 years ago

Well, i tried to send the system button input to one of my controller but its not worked out. I used something like this(vie powerShell): client_commandline.exe buttonevent press 2 0

mmorselli commented 6 years ago

Which button do you need to emulate?

For a standard button, like menu button, you should use

client_commandline.exe buttonevent pressandhold [id] 1

and to release it

client_commandline.exe buttonevent unpress [id] 1

trigger isn't a button, but a axis, so you should use

client_commandline.exe axisevent [id] 1 1 0

and to release it

client_commandline.exe axisevent [id] 1 0 0

you must use SteamVR "v1527117754 - 6/21/2018 hotfix"

buttons ids

/** VR controller button and axis IDs */

    k_EButton_System            = 0,
    k_EButton_ApplicationMenu   = 1,
    k_EButton_Grip              = 2,
    k_EButton_DPad_Left         = 3,
    k_EButton_DPad_Up           = 4,
    k_EButton_DPad_Right        = 5,
    k_EButton_DPad_Down         = 6,
    k_EButton_A                 = 7