From 9b254abdce4b05bee39eb7f1083eedf045ed552a Mon Sep 17 00:00:00 2001 From: Kevin Lukritz Date: Mon, 9 Nov 2020 10:38:54 -0600 Subject: [PATCH] Updated so it will stop as soon as you hit stop --- KeyPresser.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/KeyPresser.ps1 b/KeyPresser.ps1 index a7b2aa2..0fd13d8 100644 --- a/KeyPresser.ps1 +++ b/KeyPresser.ps1 @@ -38,8 +38,10 @@ while($sync["x"] -eq 1){ $keys = $keys -split "," Foreach ($key in $keys){ - Start-Sleep -Milliseconds 500 - [System.Windows.Forms.SendKeys]::SendWait("{$key}") + if ($sync["x"] -eq 1){ + Start-Sleep -Milliseconds 500 + [System.Windows.Forms.SendKeys]::SendWait("{$key}") + } } } }).AddArgument($Keys)