Esempio n. 1
0
 public static void SendGuide(bool buttonDown)
 {
     if (buttonDown)
     {
         state.Buttons |= GamePadControl.Guide;
     }
     else
     {
         state.Buttons &= ~GamePadControl.Guide;
     }
     simPad.Update();
 }
        private void UpdateMotion(Motion motion)
        {
            try {
                // The constant UI updates freeze the UI thread and cause a knock-on effect slowing everything else down
                LabelAcceleration.Dispatcher.Invoke(() => {
                    //LabelAcceleration.Content = Convert.ToInt32(motion.Acceleration);
                }, DispatcherPriority.Background);
            } catch (Exception ex) {
                Debug.WriteLine(ex.Message);
            }
            GamePad.State[0].LeftTrigger = motion.Acceleration;

            try {
                // The constant UI updates freeze the UI thread and cause a knock-on effect slowing everything else down
                LabelWhammy.Dispatcher.Invoke(() => {
                    //LabelWhammy.Content = Convert.ToInt32(motion.Whammy);
                }, DispatcherPriority.Background);
            } catch (Exception ex) {
                Debug.WriteLine(ex.Message);
            }
            GamePad.State[0].RightTrigger = motion.Whammy;

            GamePad.Update();
        }