cancel
Showing results for 
Search instead for 
Did you mean: 

Auto Oculus Touch v0.1.7 (Latest release 11 Jan 2021)

kojack
MVP
MVP
AutoOculusTouch is a library and script for AutoHotKey. It allows you to read the state of oculus controller devices (Touch, Remote or XBox controller) from within an AutoHotKey script.

Downloads

Binary release - https://github.com/rajetic/auto_oculus_touch/files/5792865/auto_oculus_touch_v0.1.7.zip
Source - https://github.com/rajetic/auto_oculus_touch


Prerequisites

You must have AutoHotKey installed. It is available from https://autohotkey.com
(AutoOculusTouch is tested against AutoHotKey version 1.1.33.02)
If you want vJoy support, you must have it installed. It is available from http://vjoystick.sourceforge.net/site/index.php/download-a-install
(AutoOculusTouch is tested against vJoy version 2.1.8)


Change History

v0.1.1 - Initial release. Built against Oculus SDK 1.10
v0.1.2 - Added capacitive sensor support. Built against Oculus SDK 1.20
v0.1.3 - Changed initialisation to use Invisible mode. Added button comments to example script.
v0.1.4 - Added vibration. Added orientation tracking (yaw, pitch, roll) for touch. More example scripts. Built against Oculus SDK 1.26
v0.1.5 - Added vJoy integration. You can now output gamepad/joystick values for axes and buttons.
v0.1.6 - The vJoy installer has a slightly higher version than the latest vJoy sdk, which breaks compatibility. I've updated it so it should work again. I've added in the Oculus and vJoy sdk files needed to compile, some people had issues setting things up. It should be fairly self contained now. Built against Oculus SDK 1.41. I've improved the vJoy script to have all buttons.
v0.1.7 - Added new functions to get axis and button values. Added position tracking for controllers and headset. Added headset rotation. Added tracking origin control (floor or eye). Changed vibration to take a length to play an effect for (replaces oneShot parameter). Updated the example scripts. Changed main auto_oculus_touch.ahk script to use faster DLLCall system. Added error messageboxes for init of oculus and vjoy. Added raw mouse movement and buttons, for games made with Unity that ignore normal AHK mouse. Updated Oculus SDK to v23.

Installation

AutoOculusTouch can be placed anywhere. No explicit installation is required.
There are several files included in the AutoOculusTouch binary release:
- auto_oculus_touch.dll      (A library that wraps around the Oculus SDK.
- vJoyInterface.dll             (Interface to the vJoy drivers)
- auto_oculus_touch.ahk      (An AutoHotKey script that defines various Oculus related functions. This is needed by the other scripts)
- oculus_remote_mouse.ahk    (Lets you use the remote as a mouse. Up/Down/Left/Right move. The centre button is left mouse. The back button is right mouse)
- oculus_remote_spotify.ahk  (Send media keys with the remote. Up is previous track, Down is next track, centre button is play/pause. Not just for spotify, works with any media key compatible program)
- oculus_touch_mouse.ahk     (Move the mouse with the right touch controller. Index trigger is left mouse. A is right mouse. Thumbstick is mouse move. Press B to reset yaw centre point to your current heading)
- oculus_touch_air_mouse.ahk (Move the mouse using pitch and yaw, like an LG TV remote, when you are holding the right hand trigger. Index trigger is left mouse.
- oculus_touch_test.ahk      (Display a GUI of all touch values)
- oculus_touch_vjoy.ahk      (Turn the Touch controllers into a virtual gamepad for DirectInput games)

You should keep these files together. The auto_oculus_touch.dll should be in the same location as any scripts you want to run.


Running

To start AutoOculusTouch, double click on one of the scripts (not auto_oculus_touch.ahk, it doesn't do anything on it's own). A green icon with a white H should appear in your system tray. AutoOculusTouch is now running.


Customising

The provided scripts has some example behaviour already defined. You can change any of this, or make your own.

AutoOculusTouch can give you:
- index and hand triggers of a Touch, as floats from 0.0 to 1.0.
- thumbstick axes as floats from -1.0 to 1.0.
- all Touch, Remote and XBox buttons (except the Oculus Home button and remote volume buttons).
- all Touch capacitive sensors.
- all Touch capacitive gestures (index pointing and thumbs up for either hand).
- Pitch, Roll and Yaw of both touch controllers and headset in degrees.
- Position of both touch controllers and headset in metres.
- Set continuous or limited time vibration effects of different frequencies and amplitudes on either touch controller.

Vibration Use
Vibration has 3 properties: frequency, amplitude and oneshot.
Frequency: 1==320Hz, 2==160Hz, 3==106.7Hz, 4=80Hz  (this is the frequency of vibration)
Amplitude: 0-255 (0 stops vibration, 1-255 are the strength)

Orientation Use
Yaw: clockwise is positive
Pitch: aiming up is positive
Roll: tilting clockwise is positive
Yaw works a little different to the other two angles. Pitch and roll have definite zero angles that make sense (holding the controller level). But yaw is based on where the controller is aiming when powered on. To fix this, you can call ResetFacing(controllerNumber) to record the current direction as a Yaw of 0 degrees.
Each controller may have a different Yaw origin.

vJoy Support
Normally AutoHotKey can only generate keyboard and mouse events.
vJoy is a driver that emulates one or more virtual joysticks with configurable features. AutoOculusTouch can now send analog axis and digital button values to vJoy. This lets you use Touch (or the remote) as a gamepad in games that support DirectInput.
Note: while most of the controls match an XBox controller, it technically isn't one. Any game that uses XInput directly can't see vJoy. Only DirectInput games will work here.

To use vJoy support, you need to install the vJoy drivers. You can download them from here: http://vjoystick.sourceforge.net/site/index.php/download-a-install
If you don't want vJoy support, you don't need to install the drivers, this is an optional feature, AutoOculusTouch works like v0.1.4 without it.

Important Notes

(v0.1.2 and below)
Due to the way the Oculus SDK works, running AutoOculusTouch will make Oculus Home or Dash think that a VR application is running that isn't rendering. The original intent was for AutoOculusTouch to run when no headset is being worn, such as using the Oculus Remote for controlling a PC for media playback, so this didn't matter. Running both AutoOculusTouch and another VR application at the same time probably shouldn't work, but it currently seems to.

What does this mean? Well, Oculus Home and Dash refuse to run a VR app while another is already running. But you can still run multiple apps at once if you start them using a means besides Home or Dash (such as explorer).

(v0.1.3 and above)
The note above is no longer valid in these versions. By setting the Invisible flag when calling the oculus sdk, AutoOculusTouch no longer appears to Dash as a VR app. This means it won't make the headset show a never ending loading screen and other VR apps can be run from Dash without an error.

(v0.1.7 and above)
New ways to access buttons and triggers have been added. You no longer need to grab the full buttons state and do boolean maths on them. You also no longer need to store previous trigger values to check of crossing over a value, there's a function for that.
The old way is still available existing scripts should work the same.

Different Headset Behaviour
Different Oculus headsets behave differently when not being worn (having the face sensor triggered). This is the Oculus SDK's behaviour, not Auto Oculus Touch.
Rift CV1 - When not worn for around 18 seconds, position tracking is disabled. Rotation tracking continues, but is purely IMU based (instead of the cameras) so the yaw can drift over time.
Rift-S - When not worn for around 18 seconds, position tracking, rotation tracking and vibration is disabled. Buttons, triggers and thumbsticks keep working.
Quest 1/2 Link - When not worn for around 16 seconds, everything stops. No tracking, buttons, etc. The controllers are completely shut down.

You can trick the headset into running by placing something (like a cloth) over the face sensor (just above the lenses, in the middle). But be warned, when it is triggered, all controls will be picked up by the Home app. You may be accidentally clicking on things (like the store!). I have plans to fix this, but it means adding rendering to AOT.

Function Reference


InitOculus()
- Initialise Auto Oculus Touch, start the Oculus runtime.

InitvJoy(device)
- Start the vJoy input feeder. Device is the number of the vJoy virtual gamepad. The first gamepad is 1. Only a single vJoy controller can be used by an AOT script, but you can have multiple scripts runnings at once, each using a different vJoy controller.

Poll()
- Update the tracking state and all inputs. Poll() should be called regularly (such as 90+ times a second), otherwise all inputs stop updating.

Wearing()
- Check if the headset is being worn (face sensor).
- Returns: 0 if not worn, 1 if worn.

IsDown(button), IsPressed(button), IsReleased(button)
- Check if a button is active. Down means held down, Pressed means changed from up to down since the last Poll(), Released means changed from down to up since the last Poll().
- button: one of the button enums from auto_oculus_touch.ahk, such as ovrA.
- Returns: 1 if pressed/released/down, otherwise 0.

IsTouchDown(button), IsTouchPressed(button), IsTouchReleased(button)
- Check if a capacitive touch sensor is active. Down means held down, Pressed means changed from up to down since the last Poll(), Released means changed from down to up since the last Poll().
- button: one of the capacitive sensor enums from auto_oculus_touch.ahk, such as ovrTouch_A.
- Returns: 1 if pressed/released/down, otherwise 0.

GetButtonsDown(), GetButtonsPressed(), GetButtonsReleased()
- Gets the state of every button as a bit field (one bit per button). Down means held down, Pressed means changed from up to down since the last Poll(), Released means changed from down to up since the last Poll().
- Returns: bit field. You can check a button by masking it with a button enum.
Example:
if GetButtonsDown() & ovrA

GetTouchDown(), GetTouchPressed(), GetTouchReleased()
- Gets the state of every button as a bit field (one bit per button). Down means held down, Pressed means changed from up to down since the last Poll(), Released means changed from down to up since the last Poll().
- Returns: bit field. You can check a button by masking it with a button enum.
Example:
if GetTouchDown() & ovrTouch_A

GetAxis(axis)
- Gets the current value of an analog axis, such as a trigger ot thumbstick.
- axis: one of the axis enums from auto_oculus_touch.ahk, such as AxisIndexTriggerLeft.
- Returns: triggers give 0.0 to 1.0 range. Thumbstick axes give -1.0 to 1.0 range.

Reached(axis, threshold)
-Check if an analog axis has crossed over a threshold value since the last Poll().
-axis: one of the axis enums from auto_oculus_touch.ahk, such as AxisIndexTriggerLeft.
-threshold: value that triggers an activation.
-Returns: If the axis went from below threshold to equal or greater, returns 1.
          If the axis went from greater or equal to the threshold to below, returns -1.
          If the threshold wasn't crossed since the last Poll(), returns 0.

GetTrigger(hand, trigger)
- Gets the current value of a trigger.
- hand: LeftHand or RightHand enums (0 or 1)
- trigger: IndexTrigger or HandTrigger enums
- Returns: 0.0 to 1.0

GetThumbStick(hand, axis)
- Gets the current value of a thumbstick axis.
- hand: LeftHand or RightHand enums (0 or 1)
- axis: XAxis or YAxis enums
- Returns: -1.0 to 1.0

GetPitch(controller)
- Get the Pitch in degrees of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: angle in degrees in -90.0 to 90.0 range.

GetYaw(controller)
- Get the Yaw in degrees of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: angle in degrees in -180.0 to 180.0 range.

GetRoll(controller)
- Get the Roll in degrees of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: angle in degrees in -180.0 to 180.0 range.

GetPositionX(controller)
- Get the X position in metres of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: position.

GetPositionY(controller)
- Get the Y position in metres of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: position.

GetPositionZ(controller)
- Get the Z position in metres of a touch controller or headset.
- controller: LeftHand, RightHand or Head enums.
- Returns: position.

SetTrackingOrigin(origin)
- Set the origin type used by the tracking system. Floor origin places (0,0,0) at the room calibrated origin at floor level. Eye origin places (0,0,0) where the headset is when started.
- origin: OriginEye or OriginFloor enums.

ResetFacing(controller)
- Reset the current Yaw to 0.
- controller: LeftHand, RightHand or Head enums.

SetvJoyAxis(axis, value)
- Send an axis value to vJoy.
- axis: one of the vJoy HID enums such as HID_USAGE_X.
- value: 0.0 to 1.0 range

SetvJoyAxisU(axis, value)
- Send an axis value to vJoy, expanding it's range from (0.0 to 1.0) to (-1.0 to 1.0).
- axis: one of the vJoy HID enums such as HID_USAGE_X.
- value: 0.0 to 1.0 range

SetvJoyButton(button, value)
- Send a button state to vJoy.
- button: the number of a button, starting at 1.
- value: 0 for up, 1 for down.

SendRawMouseMove(x, y, z)
- Some games ignore AutoHotKey mouse movement. This attempts to fix that.
- x: x axis movement offset.
- y: y axis movement offset.
- z: mouse wheel movement offset.

SendRawMouseButtonDown(button), SendRawMouseButtonUp(button)
- Some games ignore AutoHotKey mouse buttons. This attempts to fix that.
- button: LeftMouse, RightMouse or MiddleMouse enums

Vibrate(controller, frequency, amplitude, length)
- Turn on or off vibration of a controller.
- controller: LeftHand or RightHand enum.
- frequency: 1==320Hz, 2==160Hz, 3==106.7Hz, 4=80Hz
- amplitude: 0 to 255 for vibration strength.
- length: If 0, the vibration is infinite, otherwise it is the length in seconds before the vibration stops.


Simple Starting Script

    #include auto_oculus_touch.ahk
    InitOculus()
    Loop {
        Poll()
        ; Do your stuff here.
        Sleep, 10
    }


Scripts

Here's some scripts that others have made that use this:
Fallout4 VR  - https://www.reddit.com/r/oculus/comments/7ltym1/fully_functional_touch_profile_for_fallout_4_vr/ ; by DickDastardlyUK
Doom VFR - https://www.reddit.com/r/oculus/comments/7h6nva/smooth_locomotion_in_doomvfr_for_rift_i_scripted/ by SpeakeasyArcade

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
204 REPLIES 204

THEPWN3R
Honored Guest
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)



dkjq
Honored Guest
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(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
}
edit: fixed typoes in X and Y buttons

kojack
MVP
MVP

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
}




That looks about right.
If you use the new 0.1.7 version, you can get rid of the oldLeftX, oldLeftY, etc and use the new Reached function instead. The previous values of the triggers are now stored internally so it can check for crossing over a value. For example, this style of code:
leftX := GetThumbStick(LeftHand, XAxis)
if (leftX < -0.5) and (oldLeftX >= -0.5)

      SendInput {A down}

if (leftX >= -0.5) and (oldLeftX < -0.5)

      SendInput {A up}

oldLeftX := leftX
can be replaced with this:
leftX := GetThumbStick(LeftHand, XAxis)
if Reached(leftX, -0.5) == -1
      SendInput {A down}

if Reached(leftX, -0.5) == 1

      SendInput {A up}

Reached returns -1 if leftX goes below the threshold (-0.5 in this example) on this update, 1 if it goes above on this update, and 0 if it hasn't crossed up this update.

But the way you have it still works too.


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)


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.
But yep, you could in theory record the position of the controls as a default position and orientation as the default facing direction, then get how far its moved in the forward direction and send that to vjoy as an axis, so effectively you'd have a push yoke.
One day I really should think about redoing AOT from scratch using Lua instead of auto hot key. It wouldn't have all the ahk features (gui, etc) but it would be much nicer to write scripts with maths and stuff. Yeah, another thing to add to the never ending stack of project ideas. 🙂


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

The_Spellwright
Explorer
Hi there! I downloaded and tested this out today on my Quest 2. Using the test script that you included in the download, I was able to read my Oculus input/coordinates/etc while connected via a link cable. However, when connecting via Virtual Desktop, the test script didn't register my headset or controllers at all. Do you know if anyone has been able to successfully use this tool while connected wirelessly via Virtual Desktop?

(Pinging:
@@Neil_Araura , since he was asking about Virtual Desktop earlier in this thread.)

The_Spellwright
Explorer
@kojack -- Sorry to post again so soon, especially since I know you don't live on these forums based on your earlier posts in this thread. 😜 This isn't by any means urgent, but I wanted to share my findings while they're still fresh on my mind.

I've spent a bit of time over the last few days trying to get Auto Oculus Touch to work with my Quest 2 over Virtual Desktop. I'm not really a tech person, mind you, so I may be utterly wrongheaded in how I've approached this problem.

Attempt 1: Running as Normal
I tried running oculus_touch_test.ahk over Virtual Desktop. It reported no input and no positional data. To make sure it wasn't an error in my installation, I ran the same script while connected via Link and it appeared to be working as intended.

(It was after this initial test that I made my previous post.)

Attempt 2: Running as Administrator
No change.

Attempt 3: Running with the v0.1.2 DLL
I wondered if perhaps Virtual Desktop doesn't send controller/headset data unless it actively detects a VR app running. I downloaded v0.1.2, which was the last version not to use the Invisible flag. Unfortunately, this version didn't have a test script packaged, so I ended up just grabbing the DLL from v0.1.2 and copying it into a folder with the v0.1.7 files.

Predictably, this didn't work at all in either Virtual Desktop or Link.

Attempt 4: Recompile the v0.1.7 DLL without Invisible Flag
Okay. So. I do have a minor in computer science. I haven't so much as compiled a program in about 15 years... until today.

I downloaded the source code from git, edited line 68 of dllmain.cpp to read "params.Flags = 0;", downloaded visual studio, opened the project, and recompiled. I then ran the v0.1.7 test script using the new dll.

As expected, the scripts now caused whatever VR I was using to hang on a loading screen. On my monitor, the test window opened as usual. While connected over Link, it seemed to mostly work, though some of the output seemed a little off. (I didn't stop to investigate.) And once again, over Virtual Desktop, I got nothing.

In retrospect, my reasoning that "invisible" would mean "invisible to Virtual Desktop" seems silly, but I was grasping at straws.

Attempt 5: Run from Steam Library w/ Various Arguments
For my final attempt, I reverted to an unedited v0.1.7 and compiled oculus_touch_test.ahk as an executable. I then added this executable to my Steam Library.

When that didn't yield better results, I tried adding first "-useoculussdk" and then "-vrmode oculu" as arguments in Steam, with still no results.

Conclusion
In this last bit of searching, I came upon a comment from the developer of Virtual Desktop:
To run against the Oculus SDK, the game needs to be injected (which is
what happens when the game is launched from the Games tab). If the game
uses a launcher, that won’t be possible.

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?

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.ahk
 
oldTrigger:=0
pitch:=0
yaw:=0
roll:=0
 
InitOculus()
InitvJoy(1)
 
 
Loop {
    Poll()
     ; Get the various analog values. Triggers are 0.0-1.0, thumbsticks are -1.0-1.0
    leftIndexTrigger  := 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,R
 
    Sleep, 10
}

 

 

 

DEGEILEN
Protege

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!

The_Spellwright
Explorer

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.

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!

Anonymous
Not applicable

It works with air link