public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonReleased(value, rdrAlt))
     {
         controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.Throttle75, 200);
         controller.Logger.LogDebug("75% throttle");
     }
 }
Beispiel #2
0
        public static void Process(States value, Controller controller)
        {
            if (Reactive.ButtonPressed(value, rightThrottleIdle))
            {
                controller.SharedState.ChangeGear(true);
            }

            if (Reactive.ButtonReleased(value, rightThrottleIdle))
            {
                controller.SharedState.ChangeGear(false);
            }
        }
Beispiel #3
0
 public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonPressed(value, MIC))
     {
         controller.SharedState.Mute = true;
         controller.DepressKey(0xCA);  // KEY_F9
     }
     if (Reactive.ButtonReleased(value, MIC))
     {
         controller.SharedState.Mute = false;
         controller.ReleaseKey(0xCA);  // KEY_F9
     }
 }
Beispiel #4
0
 public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonPressed(value, button1))
     {
         // Deployed
         controller.SharedState.ChangeGear(true);
     }
     else if (Reactive.ButtonReleased(value, button1))
     {
         // Retracted
         controller.SharedState.ChangeGear(false);
     }
 }
Beispiel #5
0
 public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonPressed(value, muteButton))
     {
         // Mute EDDI
         Task.Run(async() => await controller.SendKeyCombo(new byte[] { }, 0xCC).ConfigureAwait(false));   // KEY_F11
     }
     else if (Reactive.ButtonReleased(value, muteButton))
     {
         // Unmute EDDI
         Task.Run(async() => await controller.SendKeyCombo(new byte[] { }, 0xCD).ConfigureAwait(false));   // KEY_F12
     }
 }
 public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonPressed(value, FuelRight))
     {
         controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.SilentRunningToggle, 200);
         controller.Logger.LogDebug("Silent Running Activated");
     }
     if (Reactive.ButtonReleased(value, FuelRight))
     {
         controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.SilentRunningToggle, 200);
         controller.Logger.LogDebug("Silent Running Deactivated");
     }
 }
Beispiel #7
0
        public static void ProcessNorm(States value, Controller controller)
        {
            // Camera Quit
            if (Reactive.ButtonReleased(value, (uint)BBI32Button.Button1))
            {
                // Quit Fixed Camera
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraEnabled, 150);
            }
            if (Reactive.ButtonReleased(value, (uint)BBI32Button.Button2))
            {
                // Quit Free Camera
                QuitFreeCamera(controller);
            }

            // Orbit Lines Toggle On/Off
            if (Reactive.ButtonPressed(value, (uint)BBI32Button.Button7))
            {
                // Orbit Lines Toggle
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.OrbitLinesToggle, 150);

                controller.SharedState.OrbitLines = !controller.SharedState.OrbitLines;
                controller.Logger.LogDebug($"OrbitLines: {controller.SharedState.OrbitLines}");
            }

            // FFS Scan 180 / Rotation Lock
            if (Reactive.ButtonPressedOrReleased(value, (uint)BBI32Button.Button8))
            {
                // Rotation Lock Toggle
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.LockRotationToggle, 150);
            }

            // Cockpit HUD Toggle On/Off
            if (Reactive.ButtonPressed(value, (uint)BBI32Button.Button9))
            {
                // CRTL+ALT+G
                Task.Run(async() => await controller.SendKeyCombo(new byte[] { 0x80, 0x82 }, 0x47).ConfigureAwait(false));

                controller.Logger.LogDebug("Toggle HeadsUpDisplay");
            }

            // UI Panel Focus  <UIFocus>
            if (Reactive.ButtonPressedOrReleased(value, (uint)BBI32Button.Button10))
            {
                // Mapped to BBI32Button10 = vJoy0  Button 30
            }
        }
Beispiel #8
0
 public static void Process(States value, Controller controller)
 {
     if (Reactive.ButtonPressed(value, leftThrottleParked))
     {
         // Set the left throttle to the middle so we don't move forward or backward when the throttle is parked
         controller.SharedState.LeftThrottleEnabled = false;
         controller.SetJoystickAxis(16 * 1024, vJoy.Wrapper.Axis.HID_USAGE_RZ, vJoyTypes.Throttle);
         controller.Logger.LogDebug("Left Throttle Parked");
     }
     else if (Reactive.ButtonReleased(value, leftThrottleParked))
     {
         // Left throttle is set to move forward and backward from the center
         controller.SharedState.LeftThrottleEnabled = true;
         controller.SetJoystickAxis(32 * 1024, vJoy.Wrapper.Axis.HID_USAGE_RZ, vJoyTypes.Throttle);
         controller.Logger.LogDebug("Left Throttle Activated");
     }
 }
Beispiel #9
0
        public static void Process(States value, Controller controller)
        {
            if (controller.SharedState.HardpointsDeployed == false &&
                Reactive.ButtonPressed(value, EORDown))
            {
                controller.Logger.LogDebug($"Hardpoints out {controller.SharedState.HardpointsDeployed}");
                Task.Run(async() => await controller.SendKeyCombo(new byte[] { 0x80, 0x82 }, 0x48).ConfigureAwait(false));
                controller.SharedState.HardpointsDeployed = true;
            }

            if (controller.SharedState.HardpointsDeployed &&
                Reactive.ButtonReleased(value, EORDown))
            {
                controller.Logger.LogDebug($"Hardpoints in {controller.SharedState.HardpointsDeployed}");
                Task.Run(async() => await controller.SendKeyCombo(new byte[] { 0x80, 0x82 }, 0x48).ConfigureAwait(false));
                controller.SharedState.HardpointsDeployed = false;
            }
        }
        public static void Process(States value, Controller controller)
        {
            // Camera On/Off
            if (Reactive.ButtonPressedOrReleased(value, button22))
            {
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraDisabled, 150);
            }

            // Momentary Camera On/Off
            // Camera turns on so we can switch views quickly
            if (Reactive.ButtonPressed(value, button15))
            {
                // Start Camera
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraEnabled, 150);
            }
            else if (Reactive.ButtonReleased(value, button15))
            {
                // Quit Camera
                controller.CallActivateButton(vJoyTypes.Virtual, MappedButtons.CameraDisabled, 150);
            }
        }
Beispiel #11
0
        public static void Process(States value, Controller controller)
        {
            if (controller.SharedState != null)
            {
                // If either state of the Autopilot switch is released
                if (Reactive.MultiSwitchStateOff(value, apahButton))
                {
                    controller.SharedState.ChangeMode(EliteSharedState.Mode.Travel);
                }

                if (Reactive.ButtonPressed(value, Button27))
                {
                    controller.SharedState.ChangeMode(EliteSharedState.Mode.Fighting);
                }

                if (Reactive.ButtonPressed(value, Button28))
                {
                    controller.SharedState.ChangeMode(EliteSharedState.Mode.Mining);
                }

                if (Reactive.ButtonPressed(value, Button01))
                {
                    controller.SharedState.ThrottleShift1 = true;
                }

                if (Reactive.ButtonReleased(value, Button01))
                {
                    controller.SharedState.ThrottleShift1 = false;
                }

                if (Reactive.ButtonReleased(value, Button15))
                {
                    controller.SharedState.ThrottleShift2 = true;
                }
            }
        }