Skip to content

Commit

Permalink
Merge branch 'release/trigger-test' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
micro-artwork committed Oct 26, 2021
2 parents 463b51a + 405fa31 commit 7142384
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
27 changes: 20 additions & 7 deletions XI2DS/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

Expand All @@ -14,16 +15,28 @@ static class Program
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
bool excutable;
Mutex mutex = new Mutex(true, "XI2DS", out excutable);
if (excutable)
{
Application.Run(new FormMain());
} catch (Exception e)

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
Application.Run(new FormMain());
}
catch (Exception e)
{
Application.Exit();
}
mutex.ReleaseMutex();
}
else
{
Application.Exit();
MessageBox.Show("XI2DS is running already");
return;
}

}
}
}
4 changes: 2 additions & 2 deletions XI2DS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
[assembly: AssemblyVersion("0.9.2.0")]
[assembly: AssemblyFileVersion("0.9.2.0")]
2 changes: 2 additions & 0 deletions XI2DS/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ public static DualShock4Report XInputStateToDS4Report(State state)

if (gamepad.LeftTrigger > Gamepad.TriggerThreshold)
{
report.SetButtons(DualShock4Buttons.TriggerLeft);
report.SetAxis(DualShock4Axes.LeftTrigger, gamepad.LeftTrigger);
}

if (gamepad.RightTrigger > Gamepad.TriggerThreshold)
{
report.SetButtons(DualShock4Buttons.TriggerRight);
report.SetAxis(DualShock4Axes.RightTrigger, gamepad.RightTrigger);
}

Expand Down

0 comments on commit 7142384

Please sign in to comment.