12-17-2017 06:38 AM
01-22-2021 12:03 PM
01-24-2021 09:56 PM
#include auto_oculus_touch.ahk
; Start the Oculus sdk.
InitOculus()
; Main polling loop.
Loop {
Poll()
; Buttons... X Y Menu and Analog stick click
if IsPressed(ovrX)
SendInput {x down}
if IsReleased(ovrX)
SendInput {x up}
if IsPressed(ovrY)
SendInput {y down}
if IsReleased(ovrY)
SendInput {y up}
if IsPressed(ovrEnter)
SendInput {tab down}
if IsReleased(ovrEnter)
SendInput {tab up}
if IsPressed(ovrLThumb)
SendInput {enter down}
if IsReleased(ovrLThumb)
SendInput {enter up}
; Convert stick to WASD
leftX := GetThumbStick(LeftHand, XAxis)
leftY := GetThumbStick(LeftHand, YAxis)
if (leftX < -0.5) and (oldLeftX >= -0.5)
SendInput {A down}
if (leftX >= -0.5) and (oldLeftX < -0.5)
SendInput {A up}
if (leftX > 0.5) and (oldLeftX <= 0.5)
SendInput {D down}
if (leftX <= 0.5) and (oldLeftX > 0.5)
SendInput {D up}
if (leftY < -0.5) and (oldLeftY >= -0.5)
SendInput {S down}
if (leftY >= -0.5) and (oldLeftY < -0.5)
SendInput {S up}
if (leftY > 0.5) and (oldLeftY <= 0.5)
SendInput {W down}
if (leftY <= 0.5) and (oldLeftY > 0.5)
SendInput {W up}
oldLeftX := leftX
oldLeftY := leftY
; Trigger buttons...
leftIT := GetAxis(AxisIndexTriggerLeft)
leftHT := GetAxis(AxisHandTriggerLeft)
if (leftIT > 0.6) and (oldLeftIT <= 0.6)
SendInput {space down}
if (leftIT <= 0.6) and (oldLeftIT > 0.6)
SendInput {space up}
if (leftHT > 0.4) and (oldLeftHT <= 0.4)
SendInput {ctrl down}
if (leftHT <= 0.4) and (oldLeftHT > 0.4)
SendInput {ctrl up}
oldLeftIT := leftIT
oldLeftHT := leftHT
Sleep, 10
}
01-25-2021 10:35 AM
dkjq said:
This has been great so far! If I want a simple WASD with the left Rift S controller (and use mouse with right hand) is this how to do it? Tested in a FPS and seemed fine:#include auto_oculus_touch.ahk
; Start the Oculus sdk.
InitOculus()
; Main polling loop.
Loop {
Poll()
; Buttons... X Y Menu and Analog stick click
if IsPressed(ovrX)
SendInput {x down}
if IsReleased(ovrA)
SendInput {x up}
if IsPressed(ovrY)
SendInput {y down}
if IsReleased(ovrA)
SendInput {y up}
if IsPressed(ovrEnter)
SendInput {tab down}
if IsReleased(ovrEnter)
SendInput {tab up}
if IsPressed(ovrLThumb)
SendInput {enter down}
if IsReleased(ovrLThumb)
SendInput {enter up}
; Convert stick to WASD
leftX := GetThumbStick(LeftHand, XAxis)
leftY := GetThumbStick(LeftHand, YAxis)
if (leftX < -0.5) and (oldLeftX >= -0.5)
SendInput {A down}
if (leftX >= -0.5) and (oldLeftX < -0.5)
SendInput {A up}
if (leftX > 0.5) and (oldLeftX <= 0.5)
SendInput {D down}
if (leftX <= 0.5) and (oldLeftX > 0.5)
SendInput {D up}
if (leftY < -0.5) and (oldLeftY >= -0.5)
SendInput {S down}
if (leftY >= -0.5) and (oldLeftY < -0.5)
SendInput {S up}
if (leftY > 0.5) and (oldLeftY <= 0.5)
SendInput {W down}
if (leftY <= 0.5) and (oldLeftY > 0.5)
SendInput {W up}
oldLeftX := leftX
oldLeftY := leftY
; Trigger buttons...
leftIT := GetAxis(AxisIndexTriggerLeft)
leftHT := GetAxis(AxisHandTriggerLeft)
if (leftIT > 0.6) and (oldLeftIT <= 0.6)
SendInput {space down}
if (leftIT <= 0.6) and (oldLeftIT > 0.6)
SendInput {space up}
if (leftHT > 0.4) and (oldLeftHT <= 0.4)
SendInput {ctrl down}
if (leftHT <= 0.4) and (oldLeftHT > 0.4)
SendInput {ctrl up}
oldLeftIT := leftIT
oldLeftHT := leftHT
Sleep, 10
}
One issue (besides having to trick the headset sensor, Oculus doesn't like position tracking when the headset isn't worn) is due to orientation issues, you'll most likely need to do some vector maths to deal with directions. Adding vector maths to auto hot key's scripts looks annoying.
THEPWN3R said:
Oh wow, by chance I searched this back again to see if there was anything and there's a new update! @kojack when you say positional tracking for controllers is this what you meant with like moving the controller forward emulating the mouse moving forward or a vjoy axis?
If so any idea what a basic script for a stick for a flight game would be like? (like moving controller forward would emulate a vertical axis or mouse up)
02-03-2021 11:24 PM
02-07-2021 11:53 PM
I was unable to force Virtual Desktop's Games tab to recognize my test executable, so that's where I hit my current roadblock.
What do you think? Is this a reasonably surmountable problem, or is Auto Oculus Touch on Virtual Desktop a lost cause?
03-03-2021 10:14 PM - edited 03-04-2021 10:15 AM
Bump
@Hairog wrote:
I'm trying to get the left stick to move the mouse. I found a script that got the right stick to do what I wanted to do. I need to switch over to the left stick, so I just changed all "right" to "left". See below. Well, it doesn't work. Does anyone have any ideas?#include auto_oculus_touch.ahkoldTrigger:=0pitch:=0yaw:=0roll:=0InitOculus()InitvJoy(1)Loop {Poll(); Get the various analog values. Triggers are 0.0-1.0, thumbsticks are -1.0-1.0leftIndexTrigger := GetTrigger(LeftHand, IndexTrigger)leftHandTrigger := GetTrigger(LeftHand, HandTrigger)leftX := GetThumbStick(LeftHand, XAxis)leftY := GetThumbStick(LeftHand, YAxis)rightIndexTrigger := GetTrigger(RightHand, IndexTrigger)rightHandTrigger := GetTrigger(RightHand, HandTrigger)rightX := GetThumbStick(RightHand, XAxis)rightY := GetThumbStick(RightHand, YAxis)down := GetButtonsDown()pressed := GetButtonsPressed()released := GetButtonsReleased()touchDown := GetTouchDown()touchPressed := GetTouchPressed()touchReleased := GetTouchReleased(); Move the mouse using the left thumb stick.if (leftX>0.1) or (leftX<-0.1) or (leftY>0.1) or (leftY<-0.1)MouseMove, rightX*10, right*-10,0,RSleep, 10}
03-07-2021 08:43 AM
I am having the same issues with the Quest2 and VDesk's wireless streaming.
Would be absolutely amazing to have support for this in a future version of AOT!
03-07-2021 11:24 PM
Well, the Oculus forum let me type up a response without being logged in, then deleted my response when I did log in, so that's cool.
Anyway...
@Hairog-- I'm no expert, but at a glance, I think your problem is this line:
MouseMove, rightX*10, right*-10,0,R
1) Your MouseMove function is still using the "right" variables and
2) The second variable appears to be a typo.
Maybe try changing the line as follows and see if it works.
MouseMove, leftX*10, leftY*-10,0,R
Good luck!
@DEGEILEN- Both SteamVR and Virtual Desktop have had major updates in the last few weeks, but sadly, I still can't get this to work in VD. I've been using Link instead, but I find myself spoiled by wireless VR, and the hassle of getting out the wire and plugging into my computer has meant a lot less VR time lately. (My setup is such that I can't just leave my VR device plugged in at all times.)
At this point, I feel my only hope is that Oculus releases their rumored "Air Link" update that will allow us to use this software in a wireless environment. But that's a question of "if" more than "when", as far as I know.
06-10-2021 09:02 AM
Did either of you try this solution now that AirLink is out? I'm just starting on this to see if I can use the Quest 2 touch controllers (instead of KB+M or an XBox controller) to play non-VR games that have been modded (such as RD2) or using VorpX on my Quest 2 headset via AirLink and SteamVR. Any help to jump in is appreciated!
06-19-2021 10:41 PM
It works with air link