How to call Oculus Remote
Hi
I want to add an action by pressing a button on the Oculus Remote. But how do I call the remote? And how do I associate a button press of the remote with an action? The reference page about the Oculus HMD wasn't very helpful. :confused: |
To further clarify:
The ultimate goal is to use the remote as a replacement for all keyboard and mouse input. But for a start, I want to associate the press of the enter key on the remote with the left mouse button, in order to select options with the remote instead of the mouse. |
Are you referring to selecting options within a GUI object? If so, take a look at the GUI canvas page and canvasExample.py script (File > Quick Open: type canvasExample). Using the GUI canvas, set the cursor style to viz.CANVAS_MOUSE_VIRTUAL and apply updates to the cursor based on oculus remote signals. The example script shows how to manually update the cursor position and send mouse button events using keypresses in the ManualCursorPositionTask and ManualCursorButtonTask functions. In your case you would change the keypress checks to button checks.
|
Hi again
Thanks for your answer. I'm referring to the canvas example script, yes. I tried to change the keypresses to button checks but I can't get it working. Is there a mistake somewhere in my script? I'd be really glad for any kind of advice. Code:
import viz |
First get a handle to the remote controller:
Code:
hmd = oculus.Rift() Code:
if remote.isButtonDown(oculus.BUTTON_REMOTE_UP): |
That's exactly what I was looking for, thanks!
But how would you change the ManualCursorButtonTask function? Code:
def ManualCursorButtonTask(): |
Try using the viztask.waitSensorDown and viztask.waitSensorUp commands:
Code:
def ManualCursorButtonTask(): |
Thanks very much!
|
All times are GMT -7. The time now is 02:37 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC