public OpenVREventArgs(VREvent_t rawEvent)
 {
     EventType = (EVREventType)rawEvent.eventType;
     DeviceIndex = (int)rawEvent.trackedDeviceIndex;
     Age = rawEvent.eventAgeSeconds;
     EventData = rawEvent.data;
 }
Example #2
0
    private void OnKeyboard(Valve.VR.VREvent_t args)     //(object[] args)
    {
        StringBuilder stringBuilder = new StringBuilder(256);

        SteamVR.instance.overlay.GetKeyboardText(stringBuilder, 256);
        PlayerNameText = stringBuilder.ToString();
    }
        void Update()
        {
            if (initResponse != Error.Success)
            {
                return;
            }

            //doPostRender = false;

            OnUpdate();
            UpdateSendHotkeyCheck();

#if CVR_STEAMVR
            var system = Valve.VR.OpenVR.System;
            if (system != null)
            {
                var vrEvent = new Valve.VR.VREvent_t();
                var size    = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
                for (int i = 0; i < 64; i++)
                {
                    if (!system.PollNextEvent(ref vrEvent, size))
                    {
                        break;
                    }
                    OnPoseEvent((Valve.VR.EVREventType)vrEvent.eventType);
                }
            }
#endif
        }
    public bool PollNextEvent(ref VREvent_t pEvent)
    {
        var overlay = OpenVR.Overlay;
        if (overlay == null)
            return false;

        var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
        return overlay.PollNextOverlayEvent(handle, ref pEvent, size);
    }
Example #5
0
 public bool PollNextEvent(ref VREvent_t pEvent)
 {
     CVROverlay overlay = OpenVR.Overlay;
     if (overlay == null)
     {
         return false;
     }
     uint uncbVREvent = (uint)Marshal.SizeOf(typeof(VREvent_t));
     return overlay.PollNextOverlayEvent(this.handle, ref pEvent, uncbVREvent);
 }
 private void OnChaperoneChanged(Valve.VR.VREvent_t arg0)
 {
     if (Valve.VR.OpenVR.Chaperone.AreBoundsVisible())
     {
         new CustomEvent("cvr.boundary").SetProperty("visible", true).Send();
         Util.logDebug("chaperone visible");
     }
     else
     {
         new CustomEvent("cvr.boundary").SetProperty("visible", false).Send();
         Util.logDebug("chaperone hidden");
     }
 }
Example #7
0
    private void OnKeyboard(object[] args)
    {
        if (activeKeyboard != this)
        {
            return;
        }
        Valve.VR.VREvent_t ev       = (Valve.VR.VREvent_t)args[0];
        VREvent_Keyboard_t keyboard = ev.data.keyboard;

        byte[] inputBytes = new byte[] { keyboard.cNewInput0, keyboard.cNewInput1, keyboard.cNewInput2, keyboard.cNewInput3, keyboard.cNewInput4, keyboard.cNewInput5, keyboard.cNewInput6, keyboard.cNewInput7 };
        int    len        = 0;

        for (; inputBytes[len] != 0 && len < 7; len++)
        {
            ;
        }
        string input = System.Text.Encoding.UTF8.GetString(inputBytes, 0, len);

        if (minimalMode)
        {
            if (input == "\b")
            {
                if (text.Length > 0)
                {
                    text = text.Substring(0, text.Length - 1);
                }
            }
            else if (input == "\x1b")
            {
                // Close the keyboard
                var vr = SteamVR.instance;
                vr.overlay.HideKeyboard();
                keyboardShowing = false;
            }
            else
            {
                text += input;
            }
            textEntry.text = text;
        }
        else
        {
            System.Text.StringBuilder textBuilder = new System.Text.StringBuilder(1024);
            uint size = SteamVR.instance.overlay.GetKeyboardText(textBuilder, 1024);
            text           = textBuilder.ToString();
            textEntry.text = text;
        }
    }
Example #8
0
 private void OnKeyboardClosed(Valve.VR.VREvent_t args)     //(object[] args)
 {
     //Debug.Log("Keyboard Closed");
     if (PlayerNameText != "")
     {
         PlayerData NewPlayer = new PlayerData();
         NewPlayer.PlayerName = PlayerNameText;
         PlayerManager.GetComponent <PlayerManager>().UserPlayerData.Add(NewPlayer);
         PlayerManager.GetComponent <PlayerManager>().SavePlayer();
         UpdatePlayers();
     }
     else
     {
         //Debug.Log("Player name text is null");
     }
     GetComponent <ControllerUI>().Init = true;
 }
        void Update()
        {
            if (initResponse != Error.None)
            {
                return;
            }

            Core.InvokeUpdateEvent(Time.deltaTime);
            UpdateSendHotkeyCheck();

#if CVR_STEAMVR || CVR_STEAMVR2
            var system = Valve.VR.OpenVR.System;
            if (system != null)
            {
                var vrEvent = new Valve.VR.VREvent_t();
                var size    = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
                for (int i = 0; i < 64; i++)
                {
                    if (!system.PollNextEvent(ref vrEvent, size))
                    {
                        break;
                    }
                    OnPoseEvent((Valve.VR.EVREventType)vrEvent.eventType);
                }
            }
#endif

#if CVR_OCULUS
            if (GameplayReferences.GetControllerInfo(false, out tempControllerInfo))
            {
                tempControllerInfo.connected = OVRInput.IsControllerConnected(OVRInput.Controller.LTouch);
                tempControllerInfo.visible   = OVRInput.GetControllerPositionTracked(OVRInput.Controller.LTouch);
            }

            if (GameplayReferences.GetControllerInfo(true, out tempControllerInfo))
            {
                tempControllerInfo.connected = OVRInput.IsControllerConnected(OVRInput.Controller.RTouch);
                tempControllerInfo.visible   = OVRInput.GetControllerPositionTracked(OVRInput.Controller.RTouch);
            }
#endif
        }
Example #10
0
 private void OnKeyboard(object[] args)
 {
     if (activeKeyboard != this)
     {
         return;
     }
     Valve.VR.VREvent_t ev = (Valve.VR.VREvent_t)args[0];
     if (minimalMode)
     {
         VREvent_t evt = (VREvent_t)args[0];
         if (evt.data.keyboard.cNewInput == "\b")
         {
             if (text.Length > 0)
             {
                 text = text.Substring(0, text.Length - 1);
             }
         }
         else if (evt.data.keyboard.cNewInput == "\x1b")
         {
             // Close the keyboard
             var vr = SteamVR.instance;
             vr.overlay.HideKeyboard();
             keyboardShowing = false;
         }
         else
         {
             text += evt.data.keyboard.cNewInput;
         }
         textEntry.text = text;
     }
     else
     {
         System.Text.StringBuilder textBuilder = new System.Text.StringBuilder(1024);
         uint size = SteamVR.instance.overlay.GetKeyboardText(textBuilder, 1024);
         text           = textBuilder.ToString();
         textEntry.text = text;
     }
 }
    void Update()
    {
        if (cameras.Length == 0)
        {
            enabled = false;
            return;
        }

        // Force controller update in case no one else called this frame to ensure prevState gets updated.
        SteamVR_Controller.Update();

        // Dispatch any OpenVR events.
        var vr = SteamVR.instance;
        var vrEvent = new VREvent_t();
        for (int i = 0; i < 64; i++)
        {
            if (!vr.hmd.PollNextEvent(ref vrEvent))
                break;

            switch ((EVREventType)vrEvent.eventType)
            {
                case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
                    SteamVR_Utils.Event.Send("input_focus", false);
                    break;
                case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
                    SteamVR_Utils.Event.Send("input_focus", true);
                    break;
                default:
                    var name = System.Enum.GetName(typeof(EVREventType), vrEvent.eventType);
                    if (name != null)
                        SteamVR_Utils.Event.Send(name.Substring(8) /*strip VREvent_*/, vrEvent);
                    break;
            }
        }

        // Ensure various settings to minimize latency.
        Application.targetFrameRate = -1;
        Application.runInBackground = true; // don't require companion window focus
        QualitySettings.maxQueuedFrames = -1;
        QualitySettings.vSyncCount = 0; // this applies to the companion window
        Time.fixedDeltaTime = 1.0f / vr.hmd_DisplayFrequency;
    }
Example #12
0
	public bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent,uint uncbVREvent)
	{
		bool result = FnTable.PollNextOverlayEvent(ulOverlayHandle,ref pEvent,uncbVREvent);
		return result;
	}
        void Update()
        {
            if (cameras.Length == 0)
            {
                return;
            }
            this.UpdatePoses();
            // If our FixedUpdate rate doesn't match our render framerate, then catch the handoff here.
            SteamVR_Utils.QueueEventOnRenderThread(SteamVR.OpenVRMagic.k_nRenderEventID_PostPresentHandoff);

            // Force controller update in case no one else called this frame to ensure prevState gets updated.

            // Dispatch any OpenVR events.
            var system = OpenVR.System;

            if (system != null)
            {
                var vrEvent = new VREvent_t();
                var size    = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
                for (int i = 0; i < 64; i++)
                {
                    if (!system.PollNextEvent(ref vrEvent, size))
                    {
                        break;
                    }

                    switch ((EVREventType)vrEvent.eventType)
                    {
                    case EVREventType.VREvent_InputFocusCaptured:     // another app has taken focus (likely dashboard)
                        if (vrEvent.data.process.oldPid == 0)
                        {
                            SteamVR_Events.InputFocus.Send(false);
                        }
                        break;

                    case EVREventType.VREvent_InputFocusReleased:     // that app has released input focus
                        if (vrEvent.data.process.pid == 0)
                        {
                            SteamVR_Events.InputFocus.Send(true);
                        }
                        break;

                    case EVREventType.VREvent_ShowRenderModels:
                        SteamVR_Events.HideRenderModels.Send(false);
                        break;

                    case EVREventType.VREvent_HideRenderModels:
                        SteamVR_Events.HideRenderModels.Send(true);
                        break;

                    default:
                        SteamVR_Events.System((EVREventType)vrEvent.eventType).Send(vrEvent);
                        break;
                    }
                }
            }

            // Ensure various settings to minimize latency.
            Application.targetFrameRate     = -1;
            Application.runInBackground     = true; // don't require companion window focus
            QualitySettings.maxQueuedFrames = -1;
            QualitySettings.vSyncCount      = 0;    // this applies to the companion window
        }
Example #14
0
	public bool PollNextEvent(ref VREvent_t pEvent,uint uncbVREvent)
	{
		bool result = FnTable.PollNextEvent(ref pEvent,uncbVREvent);
		return result;
	}
Example #15
0
	public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,uint uncbVREvent,ref TrackedDevicePose_t pTrackedDevicePose)
	{
		bool result = FnTable.PollNextEventWithPose(eOrigin,ref pEvent,uncbVREvent,ref pTrackedDevicePose);
		return result;
	}
Example #16
0
 public bool PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent)
 {
     return(this.FnTable.PollNextEvent(ref pEvent, uncbVREvent));
 }
Example #17
0
 protected void OnQuit(VREvent_t vrEvent)
 {
     Application.Quit();
 }
Example #18
0
	internal static extern bool VR_IVRSystem_PollNextEvent(IntPtr instancePtr, ref VREvent_t pEvent);
Example #19
0
	public override bool PollNextEvent(ref VREvent_t pEvent)
	{
		CheckIfUsable();
		bool result = VRNativeEntrypoints.VR_IVRSystem_PollNextEvent(m_pVRSystem,ref pEvent);
		return result;
	}
Example #20
0
	internal static extern bool VR_IVROverlay_PollNextOverlayEvent(IntPtr instancePtr, ulong ulOverlayHandle, ref VREvent_t pEvent);
Example #21
0
	public abstract bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,ref TrackedDevicePose_t pTrackedDevicePose);
 private static void OnKeyboardClosed(Valve.VR.VREvent_t arg)
 {
     activeKeyboard = null;
 }
Example #23
0
    void Update()
    {
        #if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
        if (poseUpdater == null)
        {
            var go = new GameObject("poseUpdater");
            go.transform.parent = transform;
            poseUpdater = go.AddComponent<SteamVR_UpdatePoses>();
        }
        #else
        if (cameras.Length == 0)
        {
            enabled = false;
            return;
        }

        // If our FixedUpdate rate doesn't match our render framerate, then catch the handoff here.
        SteamVR_Utils.QueueEventOnRenderThread(SteamVR.Unity.k_nRenderEventID_PostPresentHandoff);
        #endif
        // Force controller update in case no one else called this frame to ensure prevState gets updated.
        SteamVR_Controller.Update();

        // Dispatch any OpenVR events.
        var system = OpenVR.System;
        if (system != null)
        {
            var vrEvent = new VREvent_t();
            var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
            for (int i = 0; i < 64; i++)
            {
                if (!system.PollNextEvent(ref vrEvent, size))
                    break;

                switch ((EVREventType)vrEvent.eventType)
                {
                    case EVREventType.VREvent_InputFocusCaptured: // another app has taken focus (likely dashboard)
                        if (vrEvent.data.process.oldPid == 0)
                        {
                            SteamVR_Utils.Event.Send("input_focus", false);
                        }
                        break;
                    case EVREventType.VREvent_InputFocusReleased: // that app has released input focus
                        if (vrEvent.data.process.pid == 0)
                        {
                            SteamVR_Utils.Event.Send("input_focus", true);
                        }
                        break;
                    case EVREventType.VREvent_ShowRenderModels:
                        SteamVR_Utils.Event.Send("hide_render_models", false);
                        break;
                    case EVREventType.VREvent_HideRenderModels:
                        SteamVR_Utils.Event.Send("hide_render_models", true);
                        break;
                    default:
                        var name = System.Enum.GetName(typeof(EVREventType), vrEvent.eventType);
                        if (name != null)
                            SteamVR_Utils.Event.Send(name.Substring(8) /*strip VREvent_*/, vrEvent);
                        break;
                }
            }
        }

        // Ensure various settings to minimize latency.
        Application.targetFrameRate = -1;
        Application.runInBackground = true; // don't require companion window focus
        QualitySettings.maxQueuedFrames = -1;
        QualitySettings.vSyncCount = 0; // this applies to the companion window

        if (lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0.0f)
        {
            var vr = SteamVR.instance;
            if (vr != null)
            {
                var timing = new Compositor_FrameTiming();
                timing.m_nSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Compositor_FrameTiming));
                vr.compositor.GetFrameTiming(ref timing, 0);

                Time.fixedDeltaTime = Time.timeScale / vr.hmd_DisplayFrequency;
                Time.maximumDeltaTime = Time.fixedDeltaTime * timing.m_nNumFramePresents;
            }
        }
    }
        }         // 0x00000001801DA4C0-0x00000001801DA500

        // Methods
        public void Unpack(ref VREvent_t unpacked)
        {
        }                                                     // 0x00000001801DA490-0x00000001801DA4C0
Example #25
0
 // Token: 0x06001EF4 RID: 7924 RVA: 0x0009CB5C File Offset: 0x0009AD5C
 public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose)
 {
     return(this.FnTable.PollNextEventWithPose(eOrigin, ref pEvent, uncbVREvent, ref pTrackedDevicePose));
 }
Example #26
0
        private void Update()
        {
            if (!SteamVR.active)
            {
                return;
            }
            this.UpdatePoses();
            CVRSystem system = OpenVR.System;

            if (system != null)
            {
                VREvent_t vrevent_t   = default(VREvent_t);
                uint      uncbVREvent = (uint)Marshal.SizeOf(typeof(VREvent_t));
                int       num         = 0;
                while (num < 64 && system.PollNextEvent(ref vrevent_t, uncbVREvent))
                {
                    EVREventType eventType = (EVREventType)vrevent_t.eventType;
                    if (eventType <= EVREventType.VREvent_InputFocusReleased)
                    {
                        if (eventType != EVREventType.VREvent_InputFocusCaptured)
                        {
                            if (eventType != EVREventType.VREvent_InputFocusReleased)
                            {
                                goto IL_CA;
                            }
                            if (vrevent_t.data.process.pid == 0u)
                            {
                                SteamVR_Events.InputFocus.Send(true);
                            }
                        }
                        else if (vrevent_t.data.process.oldPid == 0u)
                        {
                            SteamVR_Events.InputFocus.Send(false);
                        }
                    }
                    else if (eventType != EVREventType.VREvent_HideRenderModels)
                    {
                        if (eventType != EVREventType.VREvent_ShowRenderModels)
                        {
                            goto IL_CA;
                        }
                        SteamVR_Events.HideRenderModels.Send(false);
                    }
                    else
                    {
                        SteamVR_Events.HideRenderModels.Send(true);
                    }
IL_C4:
                    num++;
                    continue;
IL_CA:
                    SteamVR_Events.System((EVREventType)vrevent_t.eventType).Send(vrevent_t);
                    goto IL_C4;
                }
            }
            Application.targetFrameRate     = -1;
            Application.runInBackground     = true;
            QualitySettings.maxQueuedFrames = -1;
            QualitySettings.vSyncCount      = 0;
            if (SteamVR.settings.lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0f)
            {
                SteamVR instance = SteamVR.instance;
                if (instance != null)
                {
                    Time.fixedDeltaTime = Time.timeScale / instance.hmd_DisplayFrequency;
                }
            }
        }
    private static void OnKeyboardCharInput(Valve.VR.VREvent_t arg)
    {
        if (activeKeyboard == null)
        {
            return;
        }

        var keyboard = arg.data.keyboard;

        var inputBytes = new byte[]
        {
            keyboard.cNewInput0,
            keyboard.cNewInput1,
            keyboard.cNewInput2,
            keyboard.cNewInput3,
            keyboard.cNewInput4,
            keyboard.cNewInput5,
            keyboard.cNewInput6,
            keyboard.cNewInput7
        };

        var len = 0;

        for (; inputBytes[len] != 0 && len < 7; len++)
        {
            ;
        }

        var input = System.Text.Encoding.UTF8.GetString(inputBytes, 0, len);

        if (activeKeyboard.minimalMode)
        {
            if (input == "\b")
            {
                if (activeKeyboard.text.Length > 0)
                {
                    activeKeyboard.text = activeKeyboard.text.Substring(0, activeKeyboard.text.Length - 1);
                }
            }
            else if (input == "\x1b")
            {
                // Close the keyboard
                HideKeyboard();
            }
            else
            {
                activeKeyboard.text += input;
            }

            activeKeyboard.textEntry.text = activeKeyboard.text;
        }
        else
        {
            var vr = SteamVR.instance;
            if (vr != null)
            {
                if (strBuilder == null)
                {
                    strBuilder = new System.Text.StringBuilder(1024);
                }

                vr.overlay.GetKeyboardText(strBuilder, 1024);
                activeKeyboard.text           = strBuilder.ToString();
                activeKeyboard.textEntry.text = activeKeyboard.text;

                strBuilder.Length = 0;
            }
        }
    }
Example #28
0
 public string GetPropErrorNameFromEnum(ETrackedPropertyError error) => default;                                                                                                                                                     // 0x00000001811E0870-0x00000001811E08F0
 public bool PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent) => default;                                                                                                                                                       // 0x00000001811E0C00-0x00000001811E0D80
Example #29
0
	public override bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent)
	{
		CheckIfUsable();
		bool result = VRNativeEntrypoints.VR_IVROverlay_PollNextOverlayEvent(m_pVROverlay,ulOverlayHandle,ref pEvent);
		return result;
	}
Example #30
0
 public bool PollNextEvent(ref VREvent_t pEvent, uint uncbVREvent) => default;                                                                                                                                                       // 0x00000001811E0C00-0x00000001811E0D80
 public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose) => default;                                                                  // 0x00000001811E0BD0-0x00000001811E0C00
Example #31
0
	public abstract bool PollNextEvent(ref VREvent_t pEvent);
Example #32
0
 public bool PollNextEvent(ref VREvent_t pEvent)
 {
     var vr = SteamVR.instance;
     return vr.overlay.PollNextOverlayEvent(handle, ref pEvent);
 }
Example #33
0
	public abstract bool PollNextOverlayEvent(ulong ulOverlayHandle,ref VREvent_t pEvent);
        void Update()
        {
            if (SteamVR.active == false)
            {
                return;
            }

            UpdatePoses();

            // Dispatch any OpenVR events.
            var system = OpenVR.System;

            if (system != null)
            {
                var vrEvent = new VREvent_t();
                var size    = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(VREvent_t));
                for (int i = 0; i < 64; i++)
                {
                    if (!system.PollNextEvent(ref vrEvent, size))
                    {
                        break;
                    }

                    switch ((EVREventType)vrEvent.eventType)
                    {
                    case EVREventType.VREvent_InputFocusCaptured:     // another app has taken focus (likely dashboard)
                        if (vrEvent.data.process.oldPid == 0)
                        {
                            SteamVR_Events.InputFocus.Send(false);
                        }
                        break;

                    case EVREventType.VREvent_InputFocusReleased:     // that app has released input focus
                        if (vrEvent.data.process.pid == 0)
                        {
                            SteamVR_Events.InputFocus.Send(true);
                        }
                        break;

                    case EVREventType.VREvent_ShowRenderModels:
                        SteamVR_Events.HideRenderModels.Send(false);
                        break;

                    case EVREventType.VREvent_HideRenderModels:
                        SteamVR_Events.HideRenderModels.Send(true);
                        break;

                    default:
                        SteamVR_Events.System((EVREventType)vrEvent.eventType).Send(vrEvent);
                        break;
                    }
                }
            }

            // Ensure various settings to minimize latency.
            Application.targetFrameRate     = -1;
            Application.runInBackground     = true; // don't require companion window focus
            QualitySettings.maxQueuedFrames = -1;
            QualitySettings.vSyncCount      = 0;    // this applies to the companion window

            if (SteamVR.settings.lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0.0f)
            {
                var vr = SteamVR.instance;
                if (vr != null)
                {
                    var timing = new Compositor_FrameTiming();
                    timing.m_nSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Compositor_FrameTiming));
                    vr.compositor.GetFrameTiming(ref timing, 0);

                    Time.fixedDeltaTime = Time.timeScale / vr.hmd_DisplayFrequency;
                }
            }
        }
Example #35
0
	internal static extern bool VR_IVRSystem_PollNextEventWithPose(IntPtr instancePtr, ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, ref TrackedDevicePose_t pTrackedDevicePose);
 static void PollOverlayEvents(ulong handle)
 {
     if (m_cvrOverlay.HandleControllerOverlayInteractionAsMouse(handle, m_controller2ID))
     {
         //controller points to the overlay and event was generated. Unsure if the call above must be called every tick to generate event
         VREvent_t oEvent=new VREvent_t();
         uint oEventSize=(uint)Marshal.SizeOf(oEvent);
         while( m_cvrOverlay.PollNextOverlayEvent(handle,ref oEvent, oEventSize))
         {
             Log.WriteLineAndConsole("OVERLAY event (#"+oEvent.trackedDeviceIndex+"): " + oEvent.eventType.ToString() + " " + Enum.GetName(typeof(EVREventType), oEvent.eventType));
             switch(oEvent.eventType)
             {
                 case (uint)EVREventType.VREvent_MouseMove:
                     if (oEvent.trackedDeviceIndex==m_controller2ID)
                         Log.WriteLineAndConsole("  " + oEvent.data.mouse.x + "," + oEvent.data.mouse.y);
                     break;
             }
         }
     };
 }
Example #37
0
	public override bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin,ref VREvent_t pEvent,ref TrackedDevicePose_t pTrackedDevicePose)
	{
		CheckIfUsable();
		bool result = VRNativeEntrypoints.VR_IVRSystem_PollNextEventWithPose(m_pVRSystem,eOrigin,ref pEvent,ref pTrackedDevicePose);
		return result;
	}
 private void PollEvents(object stateIgnored)
 {
     VREvent_t vrEvent = new VREvent_t();
     while (hmd.PollNextEvent(ref vrEvent, (uint)Marshal.SizeOf<VREvent_t>()))
     {
         OpenVREvent?.Invoke(this, new OpenVREventArgs(vrEvent));
     }
 }