Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Fix togglesprint hotkey on other windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Imrglop committed Jan 24, 2021
1 parent 3b6bc6f commit 2474338
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Latite/LatiteForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,16 @@ private void moduleWorker_DoWork(object sender, DoWorkEventArgs e)
{
loop();
if (moduleWorker.CancellationPending) break;
if ((Overlay.GetKeyState(ToggleSprintBind) & 1) != 0 && !this.ToggleSprintBindOn)
if (Overlay.GetForegroundWindow() == Overlay.FindWindowA(null, "Minecraft"))
{
this.ToggleSprint(true);
} else if ((Overlay.GetKeyState(ToggleSprintBind) & 1) == 0 && this.ToggleSprintBindOn)
{
this.ToggleSprint(false);
if ((Overlay.GetKeyState(ToggleSprintBind) & 1) != 0 && !this.ToggleSprintBindOn)
{
this.ToggleSprint(true);
}
else if ((Overlay.GetKeyState(ToggleSprintBind) & 1) == 0 && this.ToggleSprintBindOn)
{
this.ToggleSprint(false);
}
}
Thread.Sleep(50);
}
Expand Down

0 comments on commit 2474338

Please sign in to comment.