Skip to content

Commit

Permalink
implement automatic Roll/Yaw swap (#229)
Browse files Browse the repository at this point in the history
- if main sensor is internal/external, swap axis to Yaw.
- if main sensor is controller, compare accelZ and accelY to swap axis.
  • Loading branch information
Valkirie authored and CasperH2O committed Apr 8, 2024
1 parent 56553f6 commit dfdd03a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
2 changes: 2 additions & 0 deletions HandheldCompanion/Extensions/GlyphExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ public static string ToGlyph(this MotionInput motionInput)
return "\uF119";
case MotionInput.WorldSpace:
return "\uE714";
/*
case MotionInput.AutoRollYawSwap:
return "\uE7F8";
*/
case MotionInput.JoystickSteering:
return "\uEC47";
}
Expand Down
2 changes: 1 addition & 1 deletion HandheldCompanion/Misc/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public enum SteeringAxis
{
Roll = 0,
Yaw = 1,
Combined = 2, // unused
Auto = 2, // unused
}

[Serializable]
Expand Down
18 changes: 9 additions & 9 deletions HandheldCompanion/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions HandheldCompanion/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2961,8 +2961,8 @@ Motion input toggle: press selected button(s) to switch motion state.</value>
<data name="OverlayPage_Xbox360Controller" xml:space="preserve">
<value>Xbox 360</value>
</data>
<data name="ProfilesPage_Combined" xml:space="preserve">
<value>Roll/Yaw</value>
<data name="ProfilesPage_RollYawAuto" xml:space="preserve">
<value>Auto</value>
</data>
<data name="Hint_MSIClawCenterCheck" xml:space="preserve">
<value>MSI Center is running</value>
Expand Down
3 changes: 1 addition & 2 deletions HandheldCompanion/Utils/InputUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ public enum MotionInput
/// While more intuitive, world space controls are challenging to implement and less suitable for handheld devices.
/// </summary>
WorldSpace = 2,
AutoRollYawSwap = 3,
JoystickSteering = 4
JoystickSteering = 3
}

public enum MotionOuput
Expand Down
6 changes: 3 additions & 3 deletions HandheldCompanion/Views/Pages/ProfilesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -958,12 +958,12 @@
<Label Content="{x:Static resx:Resources.ProfilesPage_Roll}" />
</ui:SimpleStackPanel>
</ComboBoxItem>
<!--<ComboBoxItem>
<ComboBoxItem>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="6">
<ui:FontIcon Glyph="&#xE8B4;" />
<Label Content="{x:Static resx:Resources.ProfilesPage_Combined}" />
<Label Content="{x:Static resx:Resources.ProfilesPage_RollYawAuto}" />
</ui:SimpleStackPanel>
</ComboBoxItem>-->
</ComboBoxItem>
</ComboBox>
</Grid>

Expand Down

0 comments on commit dfdd03a

Please sign in to comment.