Example #1
0
        public void PollingVREvents()
        {
            if (openVR != null)
            {
                var       size   = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
                VREvent_t pEvent = new VREvent_t();
                while (openVR.PollNextEvent(ref pEvent, size))
                {//Receive VREvent
                    EVREventType type = (EVREventType)pEvent.eventType;
                    switch (type)
                    {
                    case EVREventType.VREvent_Quit:
                        if (OnOVRConnected != null)
                        {
                            OnOVRConnected.Invoke(this, new OVRConnectedEventArgs(false));
                        }
                        break;
                        //ほかにもイベントはいろいろある
                    }

                    if (OnOVREvent != null)
                    {
                        OnOVREvent.Invoke(this, new OVREventArgs(pEvent));
                    }
                }
            }
        }
Example #2
0
        public void PollEvents()
        {
            if (Valve.VR.OpenVR.System != null && enabled)
            {
                for (int eventIndex = 0; eventIndex < maxEventsPerUpdate; eventIndex++)
                {
                    if (Valve.VR.OpenVR.System == null || !Valve.VR.OpenVR.System.PollNextEvent(ref vrEvent, vrEventSize))
                    {
                        break;
                    }

                    int uEventType = (int)vrEvent.eventType;

                    if (debugLogAllEvents)
                    {
                        EVREventType eventType = (EVREventType)uEventType;
                        Debug.Log(string.Format("[{0}] {1}", Time.frameCount, eventType.ToString()));
                    }

                    if (events[uEventType] != null)
                    {
                        events[uEventType].Invoke(vrEvent);
                    }
                }
            }
        }
    private void DigestEvent(VREvent_t pEvent)
    {
        EVREventType type = (EVREventType)pEvent.eventType;

        switch (type)
        {
        case EVREventType.VREvent_Quit:
            Debug.Log("VR - QUIT - EVENT");
            onOpenVRChange(false);
            break;

        case EVREventType.VREvent_DashboardActivated:
            onDashboardChange(true);
            break;

        case EVREventType.VREvent_DashboardDeactivated:
            onDashboardChange(false);
            break;

        case EVREventType.VREvent_EnterStandbyMode:
            onStandbyChange(true);
            break;

        case EVREventType.VREvent_LeaveStandbyMode:
            onStandbyChange(false);
            break;

        case EVREventType.VREvent_ChaperoneSettingsHaveChanged:
            onChaperoneChange();
            break;
        }

        onVREvent.Invoke(pEvent);
    }
            public OpenVRControllerInput(CVRSystem hmd, int index, EVREventType eventType, VREvent_Controller_t contEvent)
            {
                State = eventType == EVREventType.VREvent_ButtonPress ? InputState.Start : InputState.Finish;

                // CONTROLLER KEY BINDINGS ARE HERE
                switch ((EVRButtonId)contEvent.button)
                {
                case EVRButtonId.k_EButton_System:
                    // used by system, dont handle
                    break;

                case EVRButtonId.k_EButton_ApplicationMenu:
                    Input = InputType.Pause;
                    break;

                case EVRButtonId.k_EButton_Grip:
                    break;

                case EVRButtonId.k_EButton_DPad_Left:
                    break;

                case EVRButtonId.k_EButton_DPad_Up:
                    break;

                case EVRButtonId.k_EButton_DPad_Right:
                    break;

                case EVRButtonId.k_EButton_DPad_Down:
                    break;

                case EVRButtonId.k_EButton_A:
                    break;

                case EVRButtonId.k_EButton_Axis2:
                    break;

                case EVRButtonId.k_EButton_Axis3:
                    break;

                case EVRButtonId.k_EButton_Axis4:
                    break;

                case EVRButtonId.k_EButton_SteamVR_Touchpad:
                    Input = hmd.ControllerState(index).rAxis0.y > 0 ? InputType.SpeedUp : InputType.SlowDown;
                    break;

                case EVRButtonId.k_EButton_SteamVR_Trigger:
                    Input = InputType.PrimarySelect;
                    break;

                case EVRButtonId.k_EButton_Max:
                    // should never fire
                    break;

                default:
                    break;
                }
            }
Example #5
0
        public void Remove(EVREventType eventType, UnityAction <VREvent_t> action)
        {
            int eventIndex = (int)eventType;

            if (preloadedEvents || events[eventIndex] != null)
            {
                events[eventIndex].RemoveListener(action);
            }
        }
Example #6
0
 public static SteamVR_Events.Event <VREvent_t> System(EVREventType eventType)
 {
     SteamVR_Events.Event <VREvent_t> @event;
     if (!SteamVR_Events.systemEvents.TryGetValue(eventType, out @event))
     {
         @event = new SteamVR_Events.Event <VREvent_t>();
         SteamVR_Events.systemEvents.Add(eventType, @event);
     }
     return(@event);
 }
    public static Event <VREvent_t> System(EVREventType eventType)
    {
        Event <VREvent_t> e;

        if (!systemEvents.TryGetValue(eventType, out e))
        {
            e = new Event <VREvent_t>();
            systemEvents.Add(eventType, e);
        }
        return(e);
    }
Example #8
0
        public void Update()
        {
            while (OpenVR.Overlay.PollNextOverlayEvent(InternalOverlay.Handle, ref eventData, eventSize))
            {
                EVREventType type = (EVREventType)eventData.eventType;

                switch (type)
                {
                case EVREventType.VREvent_MouseButtonDown:
                    if (useTouch)
                    {
                        HandleTouchDown();
                    }
                    else
                    {
                        HandleMouseDown();
                    }
                    break;

                case EVREventType.VREvent_InputFocusReleased:
                    if (useTouch)
                    {
                        HandleTouchLost();
                    }
                    else
                    {
                        HandleMouseLost();
                    }
                    break;

                case EVREventType.VREvent_MouseButtonUp:
                    if (useTouch)
                    {
                        HandleTouchUp();
                    }
                    else
                    {
                        HandleMouseUp();
                    }
                    break;

                case EVREventType.VREvent_MouseMove:
                    if (useTouch)
                    {
                        HandleTouchMove();
                    }
                    else
                    {
                        HandleMouseMove();
                    }
                    break;
                }
            }
        }
Example #9
0
    public static void ProcessEvent(VREvent_t vrEvent)
    {
        EVREventType eventType = (EVREventType)vrEvent.eventType;

        if (eventType == EVREventType.VREvent_KeyboardDone)
        {
            string text = OpenVR.Overlay.GetKeyboardText();
            if (pendingCallback != null)
            {
                var callback = pendingCallback;
                pendingCallback = null;
                callback.Invoke(text);
            }
        }
    }
Example #10
0
        public void Add(EVREventType eventType, UnityAction <VREvent_t> action, bool removeOtherListeners = false)
        {
            int eventIndex = (int)eventType;

            if (preloadedEvents == false && events[eventIndex] == null)
            {
                events[eventIndex] = new OpenVREvent();
            }

            if (removeOtherListeners)
            {
                events[eventIndex].RemoveAllListeners();
            }

            events[eventIndex].AddListener(action);
        }
Example #11
0
        public virtual void Update()
        {
            if (!_isRendering)
            {
                return;
            }

            PreUpdateCallback?.Invoke(this, new EventArgs());

            // Mouse inputs are for dashboards only right now.

            if (InGameOverlay != null)
            {
                while (InGameOverlay.PollEvent(ref eventData))
                {
                    EVREventType type = (EVREventType)eventData.eventType;

                    HandleEvent(type, eventData);
                }
            }

            if (DashboardOverlay != null)
            {
                while (DashboardOverlay.PollEvent(ref eventData))
                {
                    EVREventType type = (EVREventType)eventData.eventType;

                    HandleEvent(type, eventData);
                }
            }

            if ((!EnableNonDashboardInput || InGameOverlay == null) && DashboardOverlay != null && !DashboardOverlay.IsVisible())
            {
                if (_wasVisible)
                {
                    _wasVisible = false;
                    HandleMouseLeaveEvent();
                }
                return;
            }

            _wasVisible = true;

            PostUpdateCallback?.Invoke(this, new EventArgs());
        }
Example #12
0
 private void PollingVREvents()
 {
     if (openVR != null)
     {
         var       size   = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t));
         VREvent_t pEvent = new VREvent_t();
         while (openVR.PollNextEvent(ref pEvent, size))
         {//Receive VREvent
             EVREventType type = (EVREventType)pEvent.eventType;
             switch (type)
             {
             case EVREventType.VREvent_Quit:
                 isOVRConnected = false;
                 break;
             }
         }
     }
 }
            public OpenVRControllerInput(CVRSystem hmd, int index, EVREventType eventType, VREvent_Controller_t contEvent)
            {
                State = eventType == EVREventType.VREvent_ButtonPress ? InputState.Start : InputState.Finish;

                // CONTROLLER KEY BINDINGS ARE HERE
                switch ((EVRButtonId)contEvent.button)
                {
                    case EVRButtonId.k_EButton_System:
                        // used by system, dont handle
                        break;
                    case EVRButtonId.k_EButton_ApplicationMenu:
                        Input = InputType.Pause;
                        break;
                    case EVRButtonId.k_EButton_Grip:
                        break;
                    case EVRButtonId.k_EButton_DPad_Left:
                        break;
                    case EVRButtonId.k_EButton_DPad_Up:
                        break;
                    case EVRButtonId.k_EButton_DPad_Right:
                        break;
                    case EVRButtonId.k_EButton_DPad_Down:
                        break;
                    case EVRButtonId.k_EButton_A:
                        break;
                    case EVRButtonId.k_EButton_Axis2:
                        break;
                    case EVRButtonId.k_EButton_Axis3:
                        break;
                    case EVRButtonId.k_EButton_Axis4:
                        break;
                    case EVRButtonId.k_EButton_SteamVR_Touchpad:
                        Input = hmd.ControllerState(index).rAxis0.y > 0 ? InputType.SpeedUp : InputType.SlowDown;
                        break;
                    case EVRButtonId.k_EButton_SteamVR_Trigger:
                        Input = InputType.PrimarySelect;
                        break;
                    case EVRButtonId.k_EButton_Max:
                        // should never fire
                        break;
                    default:
                        break;
                }
            }
Example #14
0
        void HandleEvent(EVREventType type, VREvent_t eventData)
        {
            switch (type)
            {
            case EVREventType.VREvent_KeyboardCharInput:
                KeyboardInput(new byte[] {
                    eventData.data.keyboard.cNewInput0,
                    eventData.data.keyboard.cNewInput1,
                    eventData.data.keyboard.cNewInput2,
                    eventData.data.keyboard.cNewInput3,
                    eventData.data.keyboard.cNewInput4,
                    eventData.data.keyboard.cNewInput5,
                    eventData.data.keyboard.cNewInput6,
                    eventData.data.keyboard.cNewInput7,
                });
                break;

            case EVREventType.VREvent_KeyboardDone:
                //StringBuilder text = new StringBuilder();
                //SteamVR_WebKit.OverlayManager.GetKeyboardText(text, 1024);
                //KeyboardInput(text.ToString().ToCharArray());
                break;

            case EVREventType.VREvent_MouseMove:
                HandleMouseMoveEvent(eventData);
                break;

            case EVREventType.VREvent_MouseButtonDown:
                HandleMouseButtonDownEvent(eventData);
                break;

            case EVREventType.VREvent_MouseButtonUp:
                HandleMouseButtonUpEvent(eventData);
                break;

            case EVREventType.VREvent_ScrollSmooth:
                if (_allowScrolling)
                {
                    HandleMouseScrollEvent(eventData);
                }
                break;
            }
        }
Example #15
0
    private void PumpVREvents()
    {
        VREvent_t vrEvent = default(VREvent_t);

        while (OpenVR.System.PollNextEvent(ref vrEvent))
        {
            EVREventType type = (EVREventType)vrEvent.eventType;
            switch (type)
            {
            case EVREventType.VREvent_Quit:
                companionWindow.Form.Close();
                break;

            case EVREventType.VREvent_HideRenderModels:
                Debug.WriteLine("hide render models");
                break;
            }

            OpenVRKeyboardHelper.ProcessEvent(vrEvent);
        }
    }
Example #16
0
        public void Add(EVREventType eventType, UnityAction <VREvent_t> action, bool removeOtherListeners = false)
        {
            if (!enabled)
            {
                Debug.LogError("[OpenVR XR Plugin] This events class is currently not enabled, please use SteamVR_Events instead.");
                return;
            }

            int eventIndex = (int)eventType;

            if (preloadedEvents == false && events[eventIndex] == null)
            {
                events[eventIndex] = new OpenVREvent();
            }

            if (removeOtherListeners)
            {
                events[eventIndex].RemoveAllListeners();
            }

            events[eventIndex].AddListener(action);
        }
Example #17
0
        private void DigestEvent(VREvent_t pEvent)
        {
            EVREventType type = (EVREventType)pEvent.eventType;

            switch (type)
            {
            case EVREventType.VREvent_ButtonPress:

                break;

            case EVREventType.VREvent_TrackedDeviceActivated:
                onTrackedDeviceConnected?.Invoke();
                break;

            case EVREventType.VREvent_TrackedDeviceUserInteractionStarted:
                onTrackedDeviceConnected?.Invoke();
                break;

            /*
             * case EVREventType.VREvent_TrackedDeviceUserInteractionEnded:
             *      onTrackedDeviceInteractionEnded?.Invoke();
             *      //isWearingHeadset = false;
             *      break;
             */



            case EVREventType.VREvent_DashboardActivated:
                dashboardOpened = true;
                dashboardToggledEvent.Invoke(dashboardOpened);
                //Debug.Log("open dashboard");
                break;

            case EVREventType.VREvent_DashboardDeactivated:
                dashboardOpened = false;
                dashboardToggledEvent.Invoke(dashboardOpened);
                break;
            }
        }
Example #18
0
        private void OnOpenVREventTriggered(VREvent_t evt)
        {
            if (_openVRHelper == null)
            {
                return;
            }

            EVREventType eventType = (EVREventType)evt.eventType;

            if (eventType == EVREventType.VREvent_InputFocusReleased && evt.data.process.pid == 0)
            {
                InvokeEvent(_openVRHelper, nameof(_openVRHelper.inputFocusWasReleasedEvent));
                _openVRHelper.EnableEventSystem();
            }

            if (eventType == EVREventType.VREvent_InputFocusCaptured && evt.data.process.oldPid == 0)
            {
                InvokeEvent(_openVRHelper, nameof(_openVRHelper.inputFocusWasCapturedEvent));
                _openVRHelper.DisableEventSystem();
            }

            if (eventType == EVREventType.VREvent_DashboardActivated)
            {
                InvokeEvent(_openVRHelper, nameof(_openVRHelper.inputFocusWasCapturedEvent));
                _openVRHelper.DisableEventSystem();
            }

            if (eventType == EVREventType.VREvent_DashboardDeactivated)
            {
                InvokeEvent(_openVRHelper, nameof(_openVRHelper.inputFocusWasReleasedEvent));
                _openVRHelper.EnableEventSystem();
            }

            if (eventType == EVREventType.VREvent_Quit)
            {
                Application.Quit();
            }
        }
Example #19
0
        private void ProcessEvent(EVREventType evtType, VREvent_t evt)
        {
            FDeviceIndexOut.Add((int)evt.trackedDeviceIndex);
            switch (evtType)
            {
            case EVREventType.VREvent_None:
                break;

            case EVREventType.VREvent_TrackedDeviceActivated:
                break;

            case EVREventType.VREvent_TrackedDeviceDeactivated:
                break;

            case EVREventType.VREvent_TrackedDeviceUpdated:
                break;

            case EVREventType.VREvent_TrackedDeviceUserInteractionStarted:
                break;

            case EVREventType.VREvent_TrackedDeviceUserInteractionEnded:
                break;

            case EVREventType.VREvent_IpdChanged:
                break;

            case EVREventType.VREvent_EnterStandbyMode:
                break;

            case EVREventType.VREvent_LeaveStandbyMode:
                break;

            case EVREventType.VREvent_TrackedDeviceRoleChanged:
                break;

            case EVREventType.VREvent_ButtonPress:
                break;

            case EVREventType.VREvent_ButtonUnpress:
                break;

            case EVREventType.VREvent_ButtonTouch:
                break;

            case EVREventType.VREvent_ButtonUntouch:
                break;

            case EVREventType.VREvent_MouseMove:
                break;

            case EVREventType.VREvent_MouseButtonDown:
                break;

            case EVREventType.VREvent_MouseButtonUp:
                break;

            case EVREventType.VREvent_FocusEnter:
                break;

            case EVREventType.VREvent_FocusLeave:
                break;

            case EVREventType.VREvent_Scroll:
                break;

            case EVREventType.VREvent_TouchPadMove:
                break;

            case EVREventType.VREvent_InputFocusCaptured:
                break;

            case EVREventType.VREvent_InputFocusReleased:
                break;

            case EVREventType.VREvent_SceneFocusLost:
                break;

            case EVREventType.VREvent_SceneFocusGained:
                break;

            case EVREventType.VREvent_SceneApplicationChanged:
                break;

            case EVREventType.VREvent_SceneFocusChanged:
                break;

            case EVREventType.VREvent_InputFocusChanged:
                break;

            case EVREventType.VREvent_HideRenderModels:
                break;

            case EVREventType.VREvent_ShowRenderModels:
                break;

            case EVREventType.VREvent_OverlayShown:
                break;

            case EVREventType.VREvent_OverlayHidden:
                break;

            case EVREventType.VREvent_DashboardActivated:
                break;

            case EVREventType.VREvent_DashboardDeactivated:
                break;

            case EVREventType.VREvent_DashboardThumbSelected:
                break;

            case EVREventType.VREvent_DashboardRequested:
                break;

            case EVREventType.VREvent_ResetDashboard:
                break;

            case EVREventType.VREvent_RenderToast:
                break;

            case EVREventType.VREvent_ImageLoaded:
                break;

            case EVREventType.VREvent_ShowKeyboard:
                break;

            case EVREventType.VREvent_HideKeyboard:
                break;

            case EVREventType.VREvent_OverlayGamepadFocusGained:
                break;

            case EVREventType.VREvent_OverlayGamepadFocusLost:
                break;

            case EVREventType.VREvent_OverlaySharedTextureChanged:
                break;

            case EVREventType.VREvent_DashboardGuideButtonDown:
                break;

            case EVREventType.VREvent_DashboardGuideButtonUp:
                break;

            case EVREventType.VREvent_Notification_Shown:
                break;

            case EVREventType.VREvent_Notification_Hidden:
                break;

            case EVREventType.VREvent_Notification_BeginInteraction:
                break;

            case EVREventType.VREvent_Notification_Destroyed:
                break;

            case EVREventType.VREvent_Quit:
                break;

            case EVREventType.VREvent_ProcessQuit:
                break;

            case EVREventType.VREvent_QuitAborted_UserPrompt:
                break;

            case EVREventType.VREvent_QuitAcknowledged:
                break;

            case EVREventType.VREvent_DriverRequestedQuit:
                break;

            case EVREventType.VREvent_ChaperoneDataHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneUniverseHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneTempDataHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneSettingsHaveChanged:
                break;

            case EVREventType.VREvent_SeatedZeroPoseReset:
                break;

            case EVREventType.VREvent_AudioSettingsHaveChanged:
                break;

            case EVREventType.VREvent_BackgroundSettingHasChanged:
                break;

            case EVREventType.VREvent_CameraSettingsHaveChanged:
                break;

            case EVREventType.VREvent_ReprojectionSettingHasChanged:
                break;

            case EVREventType.VREvent_StatusUpdate:
                break;

            case EVREventType.VREvent_MCImageUpdated:
                break;

            case EVREventType.VREvent_FirmwareUpdateStarted:
                break;

            case EVREventType.VREvent_FirmwareUpdateFinished:
                break;

            case EVREventType.VREvent_KeyboardClosed:
                break;

            case EVREventType.VREvent_KeyboardCharInput:
                break;

            case EVREventType.VREvent_KeyboardDone:
                break;

            case EVREventType.VREvent_ApplicationTransitionStarted:
                break;

            case EVREventType.VREvent_ApplicationTransitionAborted:
                break;

            case EVREventType.VREvent_ApplicationTransitionNewAppStarted:
                break;

            case EVREventType.VREvent_Compositor_MirrorWindowShown:
                break;

            case EVREventType.VREvent_Compositor_MirrorWindowHidden:
                break;

            case EVREventType.VREvent_Compositor_ChaperoneBoundsShown:
                break;

            case EVREventType.VREvent_Compositor_ChaperoneBoundsHidden:
                break;

            case EVREventType.VREvent_TrackedCamera_StartVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_StopVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_PauseVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_ResumeVideoStream:
                break;

            case EVREventType.VREvent_PerformanceTest_EnableCapture:
                break;

            case EVREventType.VREvent_PerformanceTest_DisableCapture:
                break;

            case EVREventType.VREvent_PerformanceTest_FidelityLevel:
                break;

            case EVREventType.VREvent_VendorSpecific_Reserved_Start:
                break;

            case EVREventType.VREvent_VendorSpecific_Reserved_End:
                break;

            default:
                break;
            }
        }
Example #20
0
	internal static extern IntPtr VR_IVRSystem_GetEventTypeNameFromEnum(IntPtr instancePtr, EVREventType eType);
Example #21
0
	public override string GetEventTypeNameFromEnum(EVREventType eType)
	{
		CheckIfUsable();
		IntPtr result = VRNativeEntrypoints.VR_IVRSystem_GetEventTypeNameFromEnum(m_pVRSystem,eType);
		return (string) Marshal.PtrToStructure(result, typeof(string));
	}
Example #22
0
 public static SteamVR_Events.Action SystemAction(EVREventType eventType, UnityAction <VREvent_t> action)
 {
     return(new SteamVR_Events.Action <VREvent_t>(SteamVR_Events.System(eventType), action));
 }
Example #23
0
	public abstract string GetEventTypeNameFromEnum(EVREventType eType);
Example #24
0
    // Token: 0x06005F65 RID: 24421 RVA: 0x00218144 File Offset: 0x00216544
    private void Update()
    {
        SteamVR_Controller.Update();
        CVRSystem system = OpenVR.System;

        if (system != null)
        {
            VREvent_t arg         = default(VREvent_t);
            uint      uncbVREvent = (uint)Marshal.SizeOf(typeof(VREvent_t));
            for (int i = 0; i < 64; i++)
            {
                if (!system.PollNextEvent(ref arg, uncbVREvent))
                {
                    break;
                }
                EVREventType eventType = (EVREventType)arg.eventType;
                if (eventType != EVREventType.VREvent_InputFocusCaptured)
                {
                    if (eventType != EVREventType.VREvent_InputFocusReleased)
                    {
                        if (eventType != EVREventType.VREvent_HideRenderModels)
                        {
                            if (eventType != EVREventType.VREvent_ShowRenderModels)
                            {
                                SteamVR_Events.System((EVREventType)arg.eventType).Send(arg);
                            }
                            else
                            {
                                SteamVR_Events.HideRenderModels.Send(false);
                            }
                        }
                        else
                        {
                            SteamVR_Events.HideRenderModels.Send(true);
                        }
                    }
                    else if (arg.data.process.pid == 0u)
                    {
                        SteamVR_Events.InputFocus.Send(true);
                    }
                }
                else if (arg.data.process.oldPid == 0u)
                {
                    SteamVR_Events.InputFocus.Send(false);
                }
            }
        }
        Application.targetFrameRate     = -1;
        Application.runInBackground     = true;
        QualitySettings.maxQueuedFrames = -1;
        QualitySettings.vSyncCount      = 0;
        if (this.lockPhysicsUpdateRateToRenderFrequency && Time.timeScale > 0f)
        {
            SteamVR instance = SteamVR.instance;
            if (instance != null)
            {
                Compositor_FrameTiming compositor_FrameTiming = default(Compositor_FrameTiming);
                compositor_FrameTiming.m_nSize = (uint)Marshal.SizeOf(typeof(Compositor_FrameTiming));
                instance.compositor.GetFrameTiming(ref compositor_FrameTiming, 0u);
                Time.fixedDeltaTime = Time.timeScale / instance.hmd_DisplayFrequency;
            }
        }
    }
Example #25
0
 public static void AddListener(EVREventType eventType, UnityAction <VREvent_t> action, bool removeOtherListeners = false)
 {
     instance.Add(eventType, action, removeOtherListeners);
 }
Example #26
0
 // Token: 0x06001EF5 RID: 7925 RVA: 0x0009CB73 File Offset: 0x0009AD73
 public string GetEventTypeNameFromEnum(EVREventType eType)
 {
     return(Marshal.PtrToStringAnsi(this.FnTable.GetEventTypeNameFromEnum(eType)));
 }
Example #27
0
 public static void RemoveListener(EVREventType eventType, UnityAction <VREvent_t> action)
 {
     instance.Remove(eventType, action);
 }
Example #28
0
        private void ProcessEvent(EVREventType evtType, VREvent_t evt)
        {
            FDeviceIndexOut.Add((int)evt.trackedDeviceIndex);

            switch (evtType)
            {
            case EVREventType.VREvent_None:
                break;

            case EVREventType.VREvent_TrackedDeviceActivated:
                break;

            case EVREventType.VREvent_TrackedDeviceDeactivated:
                break;

            case EVREventType.VREvent_TrackedDeviceUpdated:
                break;

            case EVREventType.VREvent_TrackedDeviceUserInteractionStarted:
                break;

            case EVREventType.VREvent_TrackedDeviceUserInteractionEnded:
                break;

            case EVREventType.VREvent_IpdChanged:
                break;

            case EVREventType.VREvent_EnterStandbyMode:
                break;

            case EVREventType.VREvent_LeaveStandbyMode:
                break;

            case EVREventType.VREvent_TrackedDeviceRoleChanged:
                break;

            case EVREventType.VREvent_WatchdogWakeUpRequested:
                break;

            case EVREventType.VREvent_LensDistortionChanged:
                break;

            case EVREventType.VREvent_PropertyChanged:
                break;

            case EVREventType.VREvent_WirelessDisconnect:
                break;

            case EVREventType.VREvent_WirelessReconnect:
                break;

            case EVREventType.VREvent_ButtonPress:
                break;

            case EVREventType.VREvent_ButtonUnpress:
                break;

            case EVREventType.VREvent_ButtonTouch:
                break;

            case EVREventType.VREvent_ButtonUntouch:
                break;

            case EVREventType.VREvent_DualAnalog_Press:
                break;

            case EVREventType.VREvent_DualAnalog_Unpress:
                break;

            case EVREventType.VREvent_DualAnalog_Touch:
                break;

            case EVREventType.VREvent_DualAnalog_Untouch:
                break;

            case EVREventType.VREvent_DualAnalog_Move:
                break;

            case EVREventType.VREvent_DualAnalog_ModeSwitch1:
                break;

            case EVREventType.VREvent_DualAnalog_ModeSwitch2:
                break;

            case EVREventType.VREvent_DualAnalog_Cancel:
                break;

            case EVREventType.VREvent_MouseMove:
                break;

            case EVREventType.VREvent_MouseButtonDown:
                break;

            case EVREventType.VREvent_MouseButtonUp:
                break;

            case EVREventType.VREvent_FocusEnter:
                break;

            case EVREventType.VREvent_FocusLeave:
                break;

            case EVREventType.VREvent_Scroll:
                break;

            case EVREventType.VREvent_TouchPadMove:
                break;

            case EVREventType.VREvent_OverlayFocusChanged:
                break;

            case EVREventType.VREvent_InputFocusCaptured:
                break;

            case EVREventType.VREvent_InputFocusReleased:
                break;

            case EVREventType.VREvent_SceneFocusLost:
                break;

            case EVREventType.VREvent_SceneFocusGained:
                break;

            case EVREventType.VREvent_SceneApplicationChanged:
                break;

            case EVREventType.VREvent_SceneFocusChanged:
                break;

            case EVREventType.VREvent_InputFocusChanged:
                break;

            case EVREventType.VREvent_SceneApplicationSecondaryRenderingStarted:
                break;

            case EVREventType.VREvent_SceneApplicationUsingWrongGraphicsAdapter:
                break;

            case EVREventType.VREvent_HideRenderModels:
                break;

            case EVREventType.VREvent_ShowRenderModels:
                break;

            case EVREventType.VREvent_ConsoleOpened:
                break;

            case EVREventType.VREvent_ConsoleClosed:
                break;

            case EVREventType.VREvent_OverlayShown:
                break;

            case EVREventType.VREvent_OverlayHidden:
                break;

            case EVREventType.VREvent_DashboardActivated:
                break;

            case EVREventType.VREvent_DashboardDeactivated:
                break;

            case EVREventType.VREvent_DashboardThumbSelected:
                break;

            case EVREventType.VREvent_DashboardRequested:
                break;

            case EVREventType.VREvent_ResetDashboard:
                break;

            case EVREventType.VREvent_RenderToast:
                break;

            case EVREventType.VREvent_ImageLoaded:
                break;

            case EVREventType.VREvent_ShowKeyboard:
                break;

            case EVREventType.VREvent_HideKeyboard:
                break;

            case EVREventType.VREvent_OverlayGamepadFocusGained:
                break;

            case EVREventType.VREvent_OverlayGamepadFocusLost:
                break;

            case EVREventType.VREvent_OverlaySharedTextureChanged:
                break;

            case EVREventType.VREvent_ScreenshotTriggered:
                break;

            case EVREventType.VREvent_ImageFailed:
                break;

            case EVREventType.VREvent_DashboardOverlayCreated:
                break;

            case EVREventType.VREvent_SwitchGamepadFocus:
                break;

            case EVREventType.VREvent_RequestScreenshot:
                break;

            case EVREventType.VREvent_ScreenshotTaken:
                break;

            case EVREventType.VREvent_ScreenshotFailed:
                break;

            case EVREventType.VREvent_SubmitScreenshotToDashboard:
                break;

            case EVREventType.VREvent_ScreenshotProgressToDashboard:
                break;

            case EVREventType.VREvent_PrimaryDashboardDeviceChanged:
                break;

            case EVREventType.VREvent_RoomViewShown:
                break;

            case EVREventType.VREvent_RoomViewHidden:
                break;

            case EVREventType.VREvent_Notification_Shown:
                break;

            case EVREventType.VREvent_Notification_Hidden:
                break;

            case EVREventType.VREvent_Notification_BeginInteraction:
                break;

            case EVREventType.VREvent_Notification_Destroyed:
                break;

            case EVREventType.VREvent_Quit:
                break;

            case EVREventType.VREvent_ProcessQuit:
                break;

            case EVREventType.VREvent_QuitAborted_UserPrompt:
                break;

            case EVREventType.VREvent_QuitAcknowledged:
                break;

            case EVREventType.VREvent_DriverRequestedQuit:
                break;

            case EVREventType.VREvent_ChaperoneDataHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneUniverseHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneTempDataHasChanged:
                break;

            case EVREventType.VREvent_ChaperoneSettingsHaveChanged:
                break;

            case EVREventType.VREvent_SeatedZeroPoseReset:
                break;

            case EVREventType.VREvent_AudioSettingsHaveChanged:
                break;

            case EVREventType.VREvent_BackgroundSettingHasChanged:
                break;

            case EVREventType.VREvent_CameraSettingsHaveChanged:
                break;

            case EVREventType.VREvent_ReprojectionSettingHasChanged:
                break;

            case EVREventType.VREvent_ModelSkinSettingsHaveChanged:
                break;

            case EVREventType.VREvent_EnvironmentSettingsHaveChanged:
                break;

            case EVREventType.VREvent_PowerSettingsHaveChanged:
                break;

            case EVREventType.VREvent_EnableHomeAppSettingsHaveChanged:
                break;

            case EVREventType.VREvent_SteamVRSectionSettingChanged:
                break;

            case EVREventType.VREvent_LighthouseSectionSettingChanged:
                break;

            case EVREventType.VREvent_NullSectionSettingChanged:
                break;

            case EVREventType.VREvent_UserInterfaceSectionSettingChanged:
                break;

            case EVREventType.VREvent_NotificationsSectionSettingChanged:
                break;

            case EVREventType.VREvent_KeyboardSectionSettingChanged:
                break;

            case EVREventType.VREvent_PerfSectionSettingChanged:
                break;

            case EVREventType.VREvent_DashboardSectionSettingChanged:
                break;

            case EVREventType.VREvent_WebInterfaceSectionSettingChanged:
                break;

            case EVREventType.VREvent_StatusUpdate:
                break;

            case EVREventType.VREvent_WebInterface_InstallDriverCompleted:
                break;

            case EVREventType.VREvent_MCImageUpdated:
                break;

            case EVREventType.VREvent_FirmwareUpdateStarted:
                break;

            case EVREventType.VREvent_FirmwareUpdateFinished:
                break;

            case EVREventType.VREvent_KeyboardClosed:
                break;

            case EVREventType.VREvent_KeyboardCharInput:
                break;

            case EVREventType.VREvent_KeyboardDone:
                break;

            case EVREventType.VREvent_ApplicationTransitionStarted:
                break;

            case EVREventType.VREvent_ApplicationTransitionAborted:
                break;

            case EVREventType.VREvent_ApplicationTransitionNewAppStarted:
                break;

            case EVREventType.VREvent_ApplicationListUpdated:
                break;

            case EVREventType.VREvent_ApplicationMimeTypeLoad:
                break;

            case EVREventType.VREvent_ApplicationTransitionNewAppLaunchComplete:
                break;

            case EVREventType.VREvent_ProcessConnected:
                break;

            case EVREventType.VREvent_ProcessDisconnected:
                break;

            case EVREventType.VREvent_Compositor_MirrorWindowShown:
                break;

            case EVREventType.VREvent_Compositor_MirrorWindowHidden:
                break;

            case EVREventType.VREvent_Compositor_ChaperoneBoundsShown:
                break;

            case EVREventType.VREvent_Compositor_ChaperoneBoundsHidden:
                break;

            case EVREventType.VREvent_TrackedCamera_StartVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_StopVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_PauseVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_ResumeVideoStream:
                break;

            case EVREventType.VREvent_TrackedCamera_EditingSurface:
                break;

            case EVREventType.VREvent_PerformanceTest_EnableCapture:
                break;

            case EVREventType.VREvent_PerformanceTest_DisableCapture:
                break;

            case EVREventType.VREvent_PerformanceTest_FidelityLevel:
                break;

            case EVREventType.VREvent_MessageOverlay_Closed:
                break;

            case EVREventType.VREvent_MessageOverlayCloseRequested:
                break;

            case EVREventType.VREvent_Input_HapticVibration:
                break;

            case EVREventType.VREvent_VendorSpecific_Reserved_Start:
                break;

            case EVREventType.VREvent_VendorSpecific_Reserved_End:
                break;

            default:
                break;
            }
        }
Example #29
0
	public string GetEventTypeNameFromEnum(EVREventType eType)
	{
		IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
		return (string) Marshal.PtrToStructure(result, typeof(string));
	}
Example #30
0
 public bool PollNextEventWithPose(ETrackingUniverseOrigin eOrigin, ref VREvent_t pEvent, uint uncbVREvent, ref TrackedDevicePose_t pTrackedDevicePose) => default;                                                                  // 0x00000001811E0BD0-0x00000001811E0C00
 public string GetEventTypeNameFromEnum(EVREventType eType) => default;                                                                                                                                                              // 0x00000001811E05C0-0x00000001811E0640
Example #31
0
	public string GetEventTypeNameFromEnum(EVREventType eType)
	{
		IntPtr result = FnTable.GetEventTypeNameFromEnum(eType);
		return Marshal.PtrToStringAnsi(result);
	}
Example #32
0
    protected virtual void DigestEvent(VREvent_t pEvent)
    {
        EVREventType eventType = (EVREventType)pEvent.eventType;

        switch (eventType)
        {
        case EVREventType.VREvent_MouseMove:
            UpdateMouseData(pEvent.data.mouse);
            break;

        case EVREventType.VREvent_MouseButtonDown:
            UpdateMouseData(pEvent.data.mouse, true);
            break;

        case EVREventType.VREvent_MouseButtonUp:
            UpdateMouseData(pEvent.data.mouse, false);
            break;

        case EVREventType.VREvent_FocusEnter:
            onFocusChange(true);
            _focus = true;
            break;

        case EVREventType.VREvent_FocusLeave:
            onFocusChange(false);
            _focus = false;
            break;

        case EVREventType.VREvent_DashboardActivated:
            onDashboardChange(true);
            break;

        case EVREventType.VREvent_DashboardDeactivated:
            onDashboardChange(false);
            break;

        case EVREventType.VREvent_OverlayShown:
            onVisibilityChange(true);
            break;

        case EVREventType.VREvent_OverlayHidden:
            onVisibilityChange(false);
            break;

        case EVREventType.VREvent_KeyboardCharInput:
            string txt   = "";
            var    kd    = pEvent.data.keyboard;
            byte[] bytes = new byte[]
            {
                kd.cNewInput0,
                kd.cNewInput1,
                kd.cNewInput2,
                kd.cNewInput3,
                kd.cNewInput4,
                kd.cNewInput5,
                kd.cNewInput6,
                kd.cNewInput7,
            };
            int len = 0;
            while (bytes[len++] != 0 && len < 7)
            {
                ;
            }
            string input = System.Text.Encoding.UTF8.GetString(bytes, 0, len);

            if (_isMinimal)
            {
                txt = input;
            }
            else
            {
                System.Text.StringBuilder txtB = new System.Text.StringBuilder(1024);
                Overlay.GetKeyboardText(txtB, 1024);
                txt = txtB.ToString();
            }

            onKeyboardInput(txt);
            break;

        case EVREventType.VREvent_KeyboardDone:
            onKeyboardDone();
            break;

        case EVREventType.VREvent_KeyboardClosed:
            onKeyboardClosed();
            break;

        // case EVREventType.VREvent_DashboardActivated:
        // break;

        default:
            // Debug.Log("Overlay - " + overlayName + " - : " + eventType);
            break;
        }
    }
 public static Event <VREvent_t> System(EVREventType eventType) => default;                               // 0x0000000180CBD730-0x0000000180CBD840
 public static Action SystemAction(EVREventType eventType, UnityAction <VREvent_t> action) => default;    // 0x0000000180CBD6A0-0x0000000180CBD730
Example #34
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;
                }
            }
        }
 public static Action SystemAction(EVREventType eventType, UnityAction <VREvent_t> action)
 {
     return(new Action <VREvent_t>(System(eventType), action));
 }
 public static Action RenderModelLoadedAction(UnityAction <SteamVR_RenderModel, bool> action) => default; // 0x0000000180CBD600-0x0000000180CBD6A0
 public static Event <VREvent_t> System(EVREventType eventType) => default;                               // 0x0000000180CBD730-0x0000000180CBD840