How to keep the k_EButton_Axis0 always under pressed?
I'm trying to use the handle control's k_EButton_Axis0 to move in the scene, but I have only achieved to move step by step by pressed the button again and again. So the effect is very blunt, how to keep moving continually when the button is pressed without loosening the hand ?
This doesn't seem to be overly related to OpenVR, but more about how to write code that alters its state based on if a button has been pressed and/or released in the past.
You should be able to solve this with trivial amounts of code by setting some application-side state on press/release events.
You could maintain your own state as @zao suggests, or you could call GetControllerState to see whether the button is down. Then you can move a little each frame.
Moving smoothly like that isn't a great idea, though. It's likely to make many people sick.
Thank you very much! I do need to study harder, I have used Buttonpress and ButtonUnpress to finish this work. Keep moving until the button is unpressed. I will continue to learn to develop, I hope to get your help.