public static bool GetButtonUp(uint buttonIndex) { vrButtons wandButtons = MiddleVR.VRDeviceMgr.GetWandButtons(); uint buttonNb = wandButtons.GetButtonsNb(); if (buttonIndex > buttonNb) { return(false); } switch (buttonIndex) { case 0: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton0())); case 1: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton1())); case 2: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton2())); case 3: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton3())); case 4: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton4())); case 5: return(wandButtons._IsToggledReleased(MiddleVR.VRDeviceMgr.GetWandButton5())); } return(false); }
protected void Update() { int haptionDeviceId = 0; string haptionDeviceNameBase = "Haption" + haptionDeviceId; vrButtons buttons = MiddleVR.VRDeviceMgr.GetButtons(haptionDeviceNameBase + ".Buttons"); for (uint i = 0, iEnd = buttons.GetButtonsNb(); i < iEnd; ++i) { if (buttons.IsToggled(i, true)) { MiddleVRTools.Log(1, "[+] Haption button '" + i + "' is pressed."); } else if (buttons.IsToggled(i, false)) { MiddleVRTools.Log(1, "[+] Haption button '" + i + "' is released."); } } }
void UpdateInput() { vrDeviceManager dmgr = MiddleVR.VRDeviceMgr; if (dmgr != null) { vrButtons wandButtons = dmgr.GetWandButtons(); if (wandButtons != null) { uint buttonNb = wandButtons.GetButtonsNb(); if (buttonNb > 0) { WandButton0 = wandButtons.IsPressed(dmgr.GetWandButton0()); } if (buttonNb > 1) { WandButton1 = wandButtons.IsPressed(dmgr.GetWandButton1()); } if (buttonNb > 2) { WandButton2 = wandButtons.IsPressed(dmgr.GetWandButton2()); } if (buttonNb > 3) { WandButton3 = wandButtons.IsPressed(dmgr.GetWandButton3()); } if (buttonNb > 4) { WandButton4 = wandButtons.IsPressed(dmgr.GetWandButton4()); } if (buttonNb > 5) { WandButton5 = wandButtons.IsPressed(dmgr.GetWandButton5()); } } WandAxisHorizontal = dmgr.GetWandHorizontalAxisValue(); WandAxisVertical = dmgr.GetWandVerticalAxisValue(); } }
private void UpdateInput() { vrButtons wandButtons = m_DeviceMgr.GetWandButtons(); if (wandButtons != null) { uint buttonNb = wandButtons.GetButtonsNb(); if (buttonNb > 0) { WandButton0 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton0()); } if (buttonNb > 1) { WandButton1 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton1()); } if (buttonNb > 2) { WandButton2 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton2()); } if (buttonNb > 3) { WandButton3 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton3()); } if (buttonNb > 4) { WandButton4 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton4()); } if (buttonNb > 5) { WandButton5 = wandButtons.IsPressed(m_DeviceMgr.GetWandButton5()); } } WandAxisHorizontal = m_DeviceMgr.GetWandHorizontalAxisValue(); WandAxisVertical = m_DeviceMgr.GetWandVerticalAxisValue(); }