private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            // Camera On/Off
            if (tmThrottleController.TestButtonPressedOrReleased(e.PreviousButtons, e.Buttons, button22))
            {
                if (tmThrottleController.SharedState.CameraActive)
                {
                    // Quit Camera
                    tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraDisabled, 150);
                    //tmThrottleController.VisualState.UpdateMessage("Camera Activated");
                }
                else
                {
                    // Start Camera
                    tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraEnabled, 150);
                    //tmThrottleController.VisualState.UpdateMessage("Camera Activated");
                }
                tmThrottleController.SharedState.CameraActive = !tmThrottleController.SharedState.CameraActive;
            }

            // Momentary Camera On/Off
            // Camera turns on so we can switch views quickly
            if (tmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, button15))
            {
                // Start Camera
                tmThrottleController.CallActivateButton(vJoyTypes.Virtual, 16, 150);
            }
            else if (tmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, button15))
            {
                // Quit Camera
                tmThrottleController.CallActivateButton(vJoyTypes.Virtual, 18, 150);
            }
        }
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if (TmThrottleController.TestButtonPressedOrReleased(e.PreviousButtons, e.Buttons, button16))
     {
         TmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.LightsToggle, 200);
     }
 }
Ejemplo n.º 3
0
        private void Controller_SwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            if (null != TmThrottleController.SharedState)
            {
                // If either state of the Autopilot switch is released
                if (TmThrottleController.TestMultiSwitchStateOff(e.PreviousButtons, e.Buttons, apahButton))
                {
                    TmThrottleController.SharedState.CurrentMode = EliteSharedState.Mode.Travel;
                }

                if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, Button27))
                {
                    TmThrottleController.SharedState.CurrentMode = EliteSharedState.Mode.Fighting;
                }

                if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, Button28))
                {
                    TmThrottleController.SharedState.CurrentMode = EliteSharedState.Mode.Mining;
                }

                if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, Button01))
                {
                    TmThrottleController.SharedState.ThrottleShiftStateValue = EliteSharedState.ThrottleShiftState.Shift1;
                }

                if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, Button01))
                {
                    TmThrottleController.SharedState.ThrottleShiftStateValue = EliteSharedState.ThrottleShiftState.None;
                }
            }
        }
Ejemplo n.º 4
0
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, rdrAlt))
     {
         TmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.Throttle75, 200);
         log.Debug("75% throttle");
     }
 }
        private void Controller_SwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            var button14 = (UInt32)Faz.SideWinderSC.Logic.TmThrottleButton.Button14;

            if (((e.Buttons & button14) != 0) &&
                ((e.PreviousButtons & button14) == 0))
            {
                TmThrottleController.CallActivateButton(vJoyTypes.Virtual, vButton, 200);
                tmThrottleController.TypeFullString("/clear");
                tmThrottleController.VisualState.UpdateMessage("Clear Message Log");
            }
        }
        private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, rightThrottleIdle))
            {
                tmThrottleController.SharedState.GearDeployed = true;
            }

            if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, rightThrottleIdle))
            {
                tmThrottleController.SharedState.GearDeployed = false;
            }
        }
Ejemplo n.º 7
0
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, voiceCommandButton))
     {
         tmThrottleController.SharedState.Mute = true;
         TmThrottleController.DepressKey(0xC3);  // KEY_F2
     }
     if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, voiceCommandButton))
     {
         tmThrottleController.SharedState.Mute = false;
         TmThrottleController.ReleaseKey(0xC3);  // KEY_F2
     }
 }
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, button17))
     {
         TmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.SilentRunningToggle, 200);
         log.Debug($"Silent Running Activated");
     }
     if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, button17))
     {
         TmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.SilentRunningToggle, 200);
         log.Debug($"Silent Running Deactivated");
     }
 }
Ejemplo n.º 9
0
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if (TmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, leftThrottleParked))
     {
         ZAxis.LeftEnabled = false;
         tmThrottleController.SetJoystickAxis(16 * 1024, HID_USAGES.HID_USAGE_RZ, vJoyTypes.Throttle);
         log.Debug($"Left Throttle Parked");
     }
     else if (TmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, leftThrottleParked))
     {
         ZAxis.LeftEnabled = true;
         tmThrottleController.SetJoystickAxis(32 * 1024, HID_USAGES.HID_USAGE_RZ, vJoyTypes.Throttle);
         log.Debug($"Left Throttle Activated");
     }
 }
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if ((e.Buttons & button07) == button07 &&
         tmThrottleController.SharedState.CurrentMode == EliteSharedState.Mode.Fighting)
     {
         if (null == timer)
         {
             Activate();
         }
     }
     else
     {
         if (null != timer)
         {
             Disable();
         }
     }
 }
Ejemplo n.º 11
0
        private void Controller_SwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            if (tmThrottleController.SharedState.HardpointsDeployed == false &&
                tmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, button19))
            {
                tmThrottleController.SharedState.HardpointsDeployed = true;
                tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.HardpointsToggle, 200);
                tmThrottleController.VisualState.UpdateMessage($"Hardpoints Deployed {e.Buttons} {e.PreviousButtons}");
            }

            if (tmThrottleController.SharedState.HardpointsDeployed == true &&
                tmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, button19))
            {
                tmThrottleController.SharedState.HardpointsDeployed = false;
                tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.HardpointsToggle, 200);
                tmThrottleController.VisualState.UpdateMessage($"Hardpoints Retracted  {e.Buttons} {e.PreviousButtons}");
            }
        }
Ejemplo n.º 12
0
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     // Use the speedbrake to lock the secondary fire button down.
     // This will hold the mining laser or discovery scanner on until the switch is moved off.
     // In fighting mode this switch is used to cycle the subsystem targeting.
     if (TmThrottleController.TestButtonDown(e.Buttons, button07) &&
         (TmThrottleController.SharedState.CurrentMode == EliteSharedState.Mode.Travel ||
          TmThrottleController.SharedState.CurrentMode == EliteSharedState.Mode.Mining))
     {
         TmThrottleController.SharedState.SecondaryFireActive = true;
         TmThrottleController.SetJoystickButton(true, MappedButtons.SecondaryFire, vJoyTypes.Virtual);
     }
     else if (TmThrottleController.SharedState.SecondaryFireActive)
     {
         TmThrottleController.SharedState.SecondaryFireActive = false;
         TmThrottleController.SetJoystickButton(false, MappedButtons.SecondaryFire, vJoyTypes.Virtual);
     }
 }
 private void Controller_SwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
     if ((e.Buttons & (UInt32)Faz.SideWinderSC.Logic.TmThrottleButton.Button07) != 0 &&
         tmThrottleController.SharedState.CurrentMode == EliteSharedState.Mode.Fighting)
     {
         if (null == timer)
         {
             Activate();
         }
         tmThrottleController.VisualState.UpdateMessage("Cycle Subsystem: Running");
     }
     else
     {
         if (null != timer)
         {
             Disable();
             tmThrottleController.VisualState.UpdateMessage("Cycle Subsystem: Done");
         }
     }
 }
Ejemplo n.º 14
0
        private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            if (tmThrottleController.SharedState.HardpointsDeployed == false &&
                tmThrottleController.TestButtonPressed(e.PreviousButtons, e.Buttons, button19))
            {
                log.Debug($"Hardpoints out {tmThrottleController.SharedState.HardpointsDeployed} {e.PreviousButtons} {e.Buttons}");
                //tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.HardpointsToggle, 200);
                tmThrottleController.SendKeyCombo(new byte[] { 0x80, 0x82 }, 0x48);
                tmThrottleController.SharedState.HardpointsDeployed = true;
            }

            if (tmThrottleController.SharedState.HardpointsDeployed == true &&
                tmThrottleController.TestButtonReleased(e.PreviousButtons, e.Buttons, button19))
            {
                log.Debug($"Hardpoints in {tmThrottleController.SharedState.HardpointsDeployed} {e.PreviousButtons} {e.Buttons}");
                //tmThrottleController.CallActivateButton(vJoyTypes.Virtual, MappedButtons.HardpointsToggle, 200);
                tmThrottleController.SendKeyCombo(new byte[] { 0x80, 0x82 }, 0x48);
                tmThrottleController.SharedState.HardpointsDeployed = false;
            }
        }
        private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
        {
            uint buttonIndex = 1;

            foreach (Faz.SideWinderSC.Logic.TmThrottleButton value in Enum.GetValues(typeof(Faz.SideWinderSC.Logic.TmThrottleButton)))
            {
                bool buttonPressed = (e.Buttons & (uint)value) == (uint)value;
                TmThrottleController.SetJoystickButton(buttonPressed, buttonIndex, vJoyTypes.Throttle);
                //TmThrottleController.SetJoystickButton(!buttonPressed, buttonIndex, 1);
                buttonIndex++;
            }

            buttonIndex = 1;
            foreach (Faz.SideWinderSC.Logic.TmThrottleSwitchNeutral value in Enum.GetValues(typeof(Faz.SideWinderSC.Logic.TmThrottleSwitchNeutral)))
            {
                bool buttonPressed = (e.Buttons & (uint)value) != 0;
                TmThrottleController.SetJoystickButton(!buttonPressed, buttonIndex, vJoyTypes.Virtual);
                buttonIndex++;
            }

            //this.tmThrottleController.VisualState.UpdateButtons(e.Buttons);
        }
Ejemplo n.º 16
0
 private void ControllerSwitchState(object sender, Faz.SideWinderSC.Logic.TmThrottleSwitchEventArgs e)
 {
 }