Created
April 13, 2021 17:18
-
-
Save royashbrook/18c9bd86087c6be9eeb6fd8e06d72161 to your computer and use it in GitHub Desktop.
Jiggle the mouse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#moves the mouse x location by offset p pixels | |
function Nudge($p){ | |
[System.Windows.Forms.Cursor]::Position = ` | |
[System.Drawing.Point]::New( ` | |
[System.Windows.Forms.Cursor]::Position.X+$p, ` | |
[System.Windows.Forms.Cursor]::Position.Y ) | |
} | |
#call nudge every 10ms with pos/neg value of x | |
function Jiggle(){ | |
$x = 1 | |
while($true){ | |
Start-Sleep -Milliseconds 10 | |
Nudge ($x = -$x) | |
} | |
} | |
#jiggle the mouse... | |
"Jiggling..." | |
Jiggle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment