MichaelJW / DorsalVR

VR interface for PC games
69 stars 7 forks source link

Valve Index Controller input #5

Open Jaitsu opened 3 years ago

Jaitsu commented 3 years ago

Less of an issue and more of a continued discussion from #3 regarding binding Valve Index Controller analog inputs (grip force, ostensibly trackpad pressure, etc.) to boolean/button inputs.

This will show you what's being read by the binding paths you specify. (No support for processors yet, or for seeing what gets passed to Dolphin.) Please could you let me know what's actually being output when you squeeze the grip? And I guess that can go in the new issue to make this cleaner. Thanks!

Did some testing with my Index controller, and these are the outputs from the three grip variables (note that these turned out to be the same regardless of using <ValveIndexController> or <XRController>):

These seem to fire as inputs for Dolphin when they're 1, not just nonzero, which was where my confusion was. As it turns out, using the axisDeadzone processor does work - just the max variable needs to be the desired trigger value. min can be unset, i.e. processors: axisDeadzone(max=0.4).

I'm not sure whether my right controller is more sensitive than my left or my right hand is just that much stronger, but I found 0.4 to be a comfortable value for the right hand and 0.25 for the left, as far as levels that are comfortable to trigger but unlikely to be triggered accidentally.

Also did a little testing on the trackpad. Depending on preference, <XRController>{RightHand}/trackpadTouched detects a light touch to the trackpad, but to get force we need to use <ValveIndexController>{RightHand}/trackpadForce as <XRController> doesn't expose trackpadForce. 0.15-0.20 or so seems like a reasonable default value if axisDeadzone is used. Oddly I couldn't get trackpadClicked to trigger at all.

Side note: there's currently some sort of haptic feedback being triggered, both when fingers come in range of the cap sense (when gripPressed toggles) and when the grip is squeezed enough for grip to go over 0.7, and these don't seem to be affected by which variable is bound or what values axisDeadzone is set to; might need to see about disabling these or changing them to happen when the binding registers the button-press.

(Side-side note that I should probably put in yet another issue: the pointer drift keeps happening, but I'm pretty sure it's being caused by something on Dolphin's end, as it just happened again and opening Dolphin's binding menu fixed it.)

MichaelJW commented 3 years ago

Amazing, thanks for doing all this testing! Maybe, then, I should make some different default YAMLs for different controllers - and users can of course tweak them like you have to make the settings feel right.

{RightHand}/trackpadTouched detects a light touch to the trackpad, but to get force we need to use {RightHand}/trackpadForce as doesn't expose trackpadForce.

That's interesting. It makes sense, because <XRController> is the base class, but I hadn't considered referring to the specific controller classes before. Again that would be useful for making different default YAMLs.

Side note: there's currently some sort of haptic feedback being triggered, both when fingers come in range of the cap sense (when gripPressed toggles) and when the grip is squeezed enough for grip to go over 0.7, and these don't seem to be affected by which variable is bound or what values axisDeadzone is set to; might need to see about disabling these or changing them to happen when the binding registers the button-press.

I've seen this mentioned before and, unfortunately, I think it's built in to Unity: https://forum.unity.com/threads/weird-haptic-event-on-trigger-grip-button-press.1120357/ Maybe they've added an option to disable it since that thread that I've missed, though - I'll keep an eye out.

(Side-side note that I should probably put in yet another issue: the pointer drift keeps happening, but I'm pretty sure it's being caused by something on Dolphin's end, as it just happened again and opening Dolphin's binding menu fixed it.)

I'll see if I can recreate it and will submit an issue to the Dolphin GitHub if so. With luck it might be as simple as implementing the same logic as the analog stick / D-Pad fix from before.