SteamVR Developer Hardware

SteamVR Developer Hardware

View Stats:
Vive controller - is Trigger real button?
One thing I've noticed is that the pressed 'down' state for the Trigger occurs before the "click" on the trigger switch. Is that an actual switch in the controller or is it just a mechanical effect and it's just an analog trigger?
< >
Showing 1-15 of 18 comments
oeFun-IanDunlop Mar 17, 2016 @ 8:45pm 
Anyone? Are there documents for this?
bendotcom  [developer] Mar 19, 2016 @ 12:17pm 
There is a mechanical switch, but there is also an analog activation threshold. This was added because the Valve devkit controller switches had poor feel (and some required excessive force). Since developers have been tuning the feel of their games with the existing settings for some time, we did not want to disrupt that by changing the system.

If you have an application for the physical click part, we could look at adding a new button (that no one has any current behavior for) that reflects the physical click.
oeFun-IanDunlop Mar 19, 2016 @ 4:32pm 
Thanks. That is good news that there is indeed a switch there... I think exposing that as another button would be very useful. The reason it came up is that in testing players were not releasing the trigger enough - i.e. they felt the "click" of the trigger fully depressed and were just releasing it enough to feel it return to it's un-pressed state. However, that doesn't cause the current pressed down state of the trigger to 'fire' again. So, in other words you get this awkward issue where players think the trigger is broken. I find myself instructing players - "let the trigger off more before you try to 'shoot' again".
bendotcom  [developer] Mar 19, 2016 @ 4:34pm 
There's a "hair trigger" in the Unity plugin which uses raw analog values to solve that problem. The code detects a certain amount of "release" which re-arms the trigger.
oeFun-IanDunlop Mar 19, 2016 @ 5:09pm 
I'll give that a try. I'd still like to see the actual button exposed in the API though. Thanks for your help.
gevarre Mar 20, 2016 @ 8:48am 
Speaking of trigger issues, I've got some functionality that needs to set a bool to true when the trigger is pulled and false when it's released. In Unity, I'm currently using:

if (device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger))
if (device.GetTouchUp(SteamVR_Controller.ButtonMask.Trigger))

Trouble is, a good deal of the time, the "GetTouchUp" part doesn't seem to be recognized even though I'm completely releasing the trigger. Should I be doing this differently?
Rasulis Apr 28, 2016 @ 10:47pm 
Hey guys, been wishing that mechanical switch was available tonight. I'm working on a data analysis tool that makes use of in game screenshots. A half-trigger pull puts my capture camera preview into a mode that only displays data and drops the environment, and I would love it if only the click at the end of the pull would actually snap the screenshot. As it is a half-trigger pull is too easily confused with a full one and I get lots of accidental screenshots. I can think of a few cool applications for the distinction in shooter type games as well e.g. hold breath before a long shot, semi-auto vs burst fire etc. Any chance we can get access to the mechanical switch?
cc_sander Apr 28, 2016 @ 11:23pm 
The trigger can be treated as an axis as well.

Full click on the trigger seems to correspond to value 1.0 for the trigger axis value returned from GetAxis(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger). You can code up a fake click button by tracking previous frame value of the x value of the axis and register 'click' when current x value is 1.0 and last x value was not 1.0. In the same way you can register 'unclick' when current x value is not 1.0 and last x value was 1.0. Not 100% sure how reliable this is, but it seems to be working great for me so far.
vexingenmity Apr 29, 2016 @ 1:52am 
Does the click point of the trigger actually read as 1.0, or is the full extent of the axis ending just before the click? I haven't checked myself, but its good information to know. It would be very convenient to get feedback from the axis and the click on their own. There are some things that could be done with that.
cc_sander Apr 29, 2016 @ 9:21am 
It appears the 1st time you press the trigger full click after starting SteamVR, it calibrates the click to be exactly 1.0. Before that 1st press, 1.0 can be read from axis before the click. After that initial calibration, 1.0 can only be read if you give it the full click. I agree it would be nice to just have the click be a separate button instead of having to read the axis value an infer from that which may not be 100% reliable.
Xenosmash Apr 29, 2016 @ 9:26am 
Is there a difference between GetTouchDown and GetPressDown for the trigger? Which would be more beneficial for say shooting a gun once (like a pistol)? GetTouch and GetPress also seem to work at different times when the trigger is depressed. Seems GetTouch works when the trigger is about halfway depressed where the GetPress works when it's about 3/4ths of the way down.
cc_sander Apr 29, 2016 @ 9:34am 
Interesting. I didn't know GetTouch was even an option for trigger. I assumed that was only for Touchpad where GetTouch registers when touching the pad and GetPress is for when pad is clicked down. For shooting a gun, I'm finding the 'click' of the trigger feels best as it gives a satisfying physical feedback element, but the only current method of getting click right now appears to be to read the Axis value as mentioned in my earlier post.

And in case you didn't see it there is also GetHairTrigger(Up/Down), but if you look at SteamVR_Controller.cs you can see this is just using some axis values to trigger that as well.
cc_sander Apr 29, 2016 @ 9:55am 
Just did some more testing. If you pull trigger all the way to just before click, the axis reads about .83-.87. Once you pull to click, it jumps to exactly 1.0. It seems very consistent after 100 pulls of testing.
gevarre Apr 29, 2016 @ 3:57pm 
@Xenosmash: The vive developer course by Lee Wasilenko (he's here in the forums) is a good place to start:

You have to sign up, but it's currently free. The lesson "Input Events from the Vive Controllers" go through all the different touch states for the trigger. It's pretty useful. (Thanks, Lee!)
Rasulis Apr 30, 2016 @ 11:25am 
It seems like one of my controllers has that 1.0 for button click/calibration type behavior, but the other doesn't. I've also been using the trigger touch event but its not distinct enough from the trigger click to use effectively. Just need that solid click feedback to make it distinct!
< >
Showing 1-15 of 18 comments
Per page: 15 30 50

Date Posted: Mar 16, 2016 @ 2:37pm
Posts: 18