Skip to content

Commit

Permalink
Fix issue #33 (In Linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigra committed Oct 1, 2023
1 parent 02253ce commit cbcc046
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ private void UnsubscribeFromEvent()

private void RaiseActionEvent(object sender, ActionEventArgs eventArgs)
{
mLoggerService.WriteInformationLog($"Calling adam action {eventArgs.AdamActions}");

switch (eventArgs.AdamActions)
{
case AdamActions.ToHomePosition:
Expand Down
18 changes: 10 additions & 8 deletions XpadControl.Linux.Services/Extensions/ButtonsExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace XpadControl.Linux.Services.Extensions
{
public static class ButtonsExtension
{
private static readonly Buttons dPadLeftButton = ((byte)0x9).ToButtons();
private static readonly Buttons dPadRightButton = ((byte)0x10).ToButtons();
private static readonly Buttons dPadDownButton = ((byte)0x11).ToButtons();
private static readonly Buttons dPadUpButton = ((byte)0x12).ToButtons();
private static readonly Buttons dPadLeftButton = ((byte)0x11).ToButtons();
private static readonly Buttons dPadRightButton = ((byte)0x12).ToButtons();
private static readonly Buttons dPadDownButton = ((byte)0x13).ToButtons();
private static readonly Buttons dPadUpButton = ((byte)0x14).ToButtons();

private static bool dpadLeftPressed = false;
private static bool dpadRightPressed = false;
Expand All @@ -29,10 +29,12 @@ public static Buttons ToButtons(this byte button)
0x5 => Buttons.RB,
0x6 => Buttons.Back,
0x7 => Buttons.Start,
0x9 => Buttons.DPadLeft,
0x10 => Buttons.DPadRight,
0x11 => Buttons.DPadDown,
0x12 => Buttons.DPadUp,
0x9 => Buttons.LS,
0x10 => Buttons.RS,
0x11 => Buttons.DPadLeft,
0x12 => Buttons.DPadRight,
0x13 => Buttons.DPadDown,
0x14 => Buttons.DPadUp,

_ => Buttons.None,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ private void AxisChanged(object sender, AxisEventArgs e)

#endregion


#region Raise events

protected virtual void OnRaiseAxisChangedEvent(float lx, float ly, float rx, float ry)
Expand Down

0 comments on commit cbcc046

Please sign in to comment.