cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Auto Oculus Touch Vibration Script

FruitRolla01
Level 2
I'm very new to Auto Hot Key and Auto Oculus Touch, but I'm looking to make a script for vibrating my controllers while holding the grip buttons.
Ideally, I'd like to trigger a small continuous vibration to both my controllers by holding both left and right hand grips at the same time. Then stop the vibration as soon as I let go of one or both of the grips. Is this possible to do? 
My goal is to increase my Rift S's tracking fidelity while aiming down sights using a protube. I've seen some reddit and forum posts regarding similar solutions, but I'm sort of stumped. Any help would be much appreciated ๐Ÿ™‚
-------------------------------------------------------------------------------------------------------------------------------------------------
I basically copied the beginning of the example code provided in AOT directory, and then try to add my code after the following line:  "; Now to do something with them."

Loop {
    Poll()
    if (rightHandTrigger > 0.8) and (leftHandTrigger > 0.8){
Vibrate(0, 1, 15, 0)
Vibrate(1, 1, 15, 0)
return
}

    if (rightHandTrigger < 0.8) and (leftHandTrigger<0.8){
Vibrate(0, 1, 0, 0)
Vibrate(1, 1, 0, 0)
return
}
     }
} ; this ends the main polling loop (not included in this code snippet)

4 REPLIES 4

kojack
Volunteer Moderator
Volunteer Moderator
Unfortunately the vibration code doesn't support the Rift-S, I've only gotten it to work on the CV1.
The CV1 uses different vibration style and a different programming interface.

I'll have a look over the weekend and see if I can get a version working, I've got some changes I need to make anyway for someone else.

That code does look about right, assuming the vibration is working.
Author: Oculus Monitor,  Auto Oculus Touch,  Forum Dark Mode, Phantom Touch Remover,  X-Plane Fixer
Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich
Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2

FruitRolla01
Level 2
Hmm. Interesting. The oculus_touch_test.ahk has that vibration script that I was able to use with my rift s. 

Is the issue that the controller itself can't be scripted to trigger the haptics? Whereas you can trigger it successfully with the test gui?

Thanks for looking into this @kojack. Really appreciate it. 

kojack
Volunteer Moderator
Volunteer Moderator
Strange. When I posted that, it wasn't working on my Rift-S, but was on my CV1.
But I went in to replace it with the alternative method, only to discover:
- the alternative method has never worked. I googled for help and found myself 2 years ago complaining about it. ๐Ÿ™‚
- my Rift-S is working now.

I think it was due to the headset face sensor.
When the CV1 isn't worn for 18 seconds, vibration still works.
When the Rift-S isn't worn for 18 seconds, vibration stops.

I did update the vibration code in the new 0.1.7 release (just uploaded it) though, the oneShot value has changed from a boolean (0 is infinite vibration, 1 is short pulse) to a floating point length in seconds.

Oh, and I just spotted the problem with your code: the returns in the trigger checks will shut down the script.
If a return is in a script but not in a function, its the same as quiting.
Author: Oculus Monitor,  Auto Oculus Touch,  Forum Dark Mode, Phantom Touch Remover,  X-Plane Fixer
Hardware: Threadripper 1950x, MSI Gaming Trio 2080TI, Asrock X399 Taich
Headsets: Wrap 1200VR, DK1, DK2, CV1, Rift-S, GearVR, Go, Quest, Quest 2, Reverb G2

Anonymous
Not applicable

I'm attempting to do the same thing as FruitRolla01. The oculus_touch_test.ahk shows all the events from the Touch controllers exactly as it should but the Vibration test buttons don't seem to work and i'm not able to make the controllers vibrate with even the simplest script. There was a Oculus software update just couple of days ago. Could this have changed something that affects the way vibration is handled?