From 8b70df517816cce9a912b4617c167b5c8bb02792 Mon Sep 17 00:00:00 2001 From: Kevin Lukritz Date: Mon, 9 Nov 2020 12:58:28 -0600 Subject: [PATCH] One mroe change --- KeyPresser.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/KeyPresser.ps1 b/KeyPresser.ps1 index f17e4c5..e96ee67 100644 --- a/KeyPresser.ps1 +++ b/KeyPresser.ps1 @@ -47,14 +47,14 @@ while($sync["x"] -eq 1){ - Foreach ($key in $keys){ - $ActiveHandle = [UserWindows]::GetForegroundWindow() $Process = Get-Process | ? {$_.MainWindowHandle -eq $activeHandle} | Select-Object -ExpandProperty ProcessName Write-Output $Process + Foreach ($key in $keys){ + if ($sync["x"] -eq 1 -and $Process -eq "sro_client"){ - Start-Sleep -Milliseconds 50 + #Start-Sleep -Milliseconds 50 [System.Windows.Forms.SendKeys]::SendWait("{$key}") } }