MCPcopy Create free account
hub / github.com/LibreVR/Revive / OculusTouch

Method OculusTouch

Revive/InputManager.cpp:385–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385InputManager::OculusTouch::OculusTouch(vr::VRActionSetHandle_t actionSet, vr::ETrackedControllerRole role)
386 : InputDevice(actionSet)
387 , Role(role)
388 , m_bHapticsRunning(true)
389{
390 /** Returns a handle for any path in the input system. E.g. /user/hand/right */
391 vr::VRInput()->GetInputSourceHandle(role == vr::TrackedControllerRole_RightHand ? "/user/hand/right" : "/user/hand/left", &Handle);
392
393#define GET_TOUCH_ACTION(x) vr::VRInput()->GetActionHandle( \
394 "/actions/touch/in/" #x, &m_##x)
395
396 GET_TOUCH_ACTION(Button_Enter);
397 GET_TOUCH_ACTION(Button_AX);
398 GET_TOUCH_ACTION(Button_BY);
399 GET_TOUCH_ACTION(Button_Thumb);
400
401 GET_TOUCH_ACTION(Touch_AX);
402 GET_TOUCH_ACTION(Touch_BY);
403 GET_TOUCH_ACTION(Touch_Thumb);
404 GET_TOUCH_ACTION(Touch_ThumbRest);
405 GET_TOUCH_ACTION(Touch_IndexTrigger);
406
407 GET_TOUCH_ACTION(IndexTrigger);
408 GET_TOUCH_ACTION(HandTrigger);
409 GET_TOUCH_ACTION(Thumbstick);
410 GET_TOUCH_ACTION(Recenter_Thumb);
411
412 GET_TOUCH_ACTION(Button_IndexTrigger);
413 GET_TOUCH_ACTION(Button_HandTrigger);
414
415#undef GET_HANDED_ACTION
416
417 m_HapticsThread = std::thread(HapticsThread, this);
418}
419
420InputManager::OculusTouch::~OculusTouch()
421{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected