diff --git a/Falcon BMS Alternative Launcher/Input/CommonConstants.cs b/Falcon BMS Alternative Launcher/Input/CommonConstants.cs index 74a7c98..2bb6083 100644 --- a/Falcon BMS Alternative Launcher/Input/CommonConstants.cs +++ b/Falcon BMS Alternative Launcher/Input/CommonConstants.cs @@ -29,6 +29,7 @@ public static class CommonConstants public static readonly int AXISMIN = 0; public static readonly int AXISMAX = 65536; + public static readonly int AXIS_NEUTRAL_TOLERANCE = AXISMAX / 128; public static readonly int FLUSHTIME1 = 900; public static readonly int FLUSHTIME2 = 1500; diff --git a/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs b/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs index e7fc83c..badf997 100644 --- a/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs +++ b/Falcon BMS Alternative Launcher/Windows/AxisAssignWindow.xaml.cs @@ -326,21 +326,41 @@ private void ShowAxisStatus() + ((AxisNumName)phyAxNumTmp).ToString().Replace('_', ' ') + " : " + MainWindow.deviceControl.GetJoystickMappings()[devNumTmp].GetSanitizedProductName(); - if (whoCalledWindow != AxisName.Throttle.ToString() & whoCalledWindow != AxisName.Throttle_Right.ToString()) - return; - AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; - check_ABIDLE.Visibility = Visibility.Hidden; - if ( (Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value < IDLE) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value < IDLE)) + + if (whoCalledWindow == AxisName.Cursor_X.ToString() | whoCalledWindow == AxisName.Cursor_Y.ToString()) { - AxisValueProgress.Foreground = CommonConstants.LIGHTRED; - check_ABIDLE.Visibility = Visibility.Visible; - check_ABIDLE.Content = "IDLE CUTOFF"; + if (Math.Abs(AxisValueProgress.Value) < CommonConstants.AXISMAX * 0.5 - CommonConstants.AXIS_NEUTRAL_TOLERANCE | + Math.Abs(AxisValueProgress.Value) > CommonConstants.AXISMAX * 0.5 + CommonConstants.AXIS_NEUTRAL_TOLERANCE) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTRED; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "NOT NEUTRAL"; + } + else + { + AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; + check_ABIDLE.Visibility = Visibility.Hidden; + check_ABIDLE.Content = "NOT NEUTRAL"; + } } - if ( (Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value > AB) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value > AB) ) + + if (whoCalledWindow == AxisName.Throttle.ToString() | whoCalledWindow == AxisName.Throttle_Right.ToString()) { - AxisValueProgress.Foreground = CommonConstants.LIGHTGREEN; - check_ABIDLE.Visibility = Visibility.Visible; - check_ABIDLE.Content = "AB"; + AxisValueProgress.Foreground = CommonConstants.LIGHTBLUE; + check_ABIDLE.Visibility = Visibility.Hidden; + + if ((Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value < IDLE) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value < IDLE)) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTRED; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "IDLE CUTOFF"; + } + if ((Invert.IsChecked == false && CommonConstants.AXISMAX + AxisValueProgress.Value > AB) || (Invert.IsChecked == true && CommonConstants.AXISMIN + AxisValueProgress.Value > AB)) + { + AxisValueProgress.Foreground = CommonConstants.LIGHTGREEN; + check_ABIDLE.Visibility = Visibility.Visible; + check_ABIDLE.Content = "AB"; + } } } diff --git a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml index e8b067a..28e110d 100644 --- a/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml +++ b/Falcon BMS Alternative Launcher/Windows/MainWindow.xaml @@ -9,514 +9,516 @@ Title="FalconBMS Alternative Launcher" Height="768" Width="1024" MinHeight="768" MinWidth="1024" BorderThickness="0" Closed="Window_Closed" MouseDown="MetroWindow_MouseDown" FontSize="12" WindowStartupLocation="CenterScreen" ShowTitleBar="False" WindowStyle="None" Background="#a4a9ac" OverrideDefaultWindowCommandsBrush="#a4a9ac"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +