Exemplo n.º 1
0
        private void Controller_JoystickDataChanged(object sender, XboxHidController.JoystickEventArgs e)
        {
            // receiving IJoystickRawState
            JoystickIsWorking = true;
            //Debug.WriteLine("JoystickRawState: X=" + e.jss.X + "  Y=" + e.jss.Y);

            lock (jssLock)
            {
                // keep a copy for those who poll the joystick:
                jssCurrent = new JoystickSubState(e.jss);
            }

            // if we have subscribers, notify them:
            //Debug.WriteLine("--------- 360: Controller_JoystickDataChanged");
            joystickEvent?.Invoke(this, (IJoystickSubState)jssCurrent.Clone());

            //Debug.WriteLine("JoystickSubState: Speed=" + jssCurrent.Speed + "  Turn=" + jssCurrent.Turn);
        }
Exemplo n.º 2
0
        private void Controller_JoystickDataChanged(object sender, XboxHidController.JoystickEventArgs e)
        {
            // receiving IJoystickRawState
            JoystickIsWorking = true;
            //Debug.WriteLine("JoystickRawState: X=" + e.jss.X + "  Y=" + e.jss.Y);

            lock(jssLock)
            {
                // keep a copy for those who poll the joystick:
                jssCurrent = new JoystickSubState(e.jss);
            }

            // if we have subscribers, notify them:
            //Debug.WriteLine("--------- 360: Controller_JoystickDataChanged");
            joystickEvent?.Invoke(this, (IJoystickSubState)jssCurrent.Clone());

            //Debug.WriteLine("JoystickSubState: Speed=" + jssCurrent.Speed + "  Turn=" + jssCurrent.Turn);
        }