It will lock the mouse in position unless the correct password is entered.
The mouse will be released with Ctrl-Alt-Delete although I did think about disabling that with something like this-
^!Del:: process, wait, taskmgr.exe, 5 process, close, taskmgr.exe
If another window becomes active the mouse will be released.
Alt-Tab, Win, Alt-F4 and the AppsKey have been disabled.
The script will sleep if the computer is idle for mare than 5 seconds to reduce the CPU load. the CPu is at about 20% when the user is moving the mouse but then goes down to 0% 5 seconds after they stop moving it.
;Requires Windows 2000 / XP and the latest version of Autohotkey (1.0.32+) ; ;This script will lock the mouse and only entering a password will release it ; ;Ctrl-X or Ctrl-Alt-Delete will release the mouse in an emergency ;Set Password here if you don't want to be prompted each time Password= Gui, -caption +alwaysontop Gui, Add, Button, x16 y10 w50 h30 gTrap, Lock Gui, Add, Button, x76 y10 w50 h30 gFree, Release Gui, Add, Edit, x18 y65 w110 h20 Password vGuessedPassword, Gui, Add, Text, x17 y49 w111 h15, Enter Password below: Gui, Show, h98 w146, Lock the Mouse GuiControl, Disable, Release GuiControl, Disable, Edit1 Return GuiClose: ExitApp Trap: breakloop=n incorrectpasswords=0 GuiControl, Disable, Lock GuiControl, Enable, Release WinGetPos, X, Y, Width, Height, Lock the Mouse Y+=%Height% X-=65 if Password= InputBox, Password, Set Password, Enter the password that will free the mouse, HIDE, 270, 120, %X%, %Y% if errorlevel<>0 { GuiControl, Enable, Lock GuiControl, Disable, Release return } GuiControl, Enable, Edit1 winactivate, Lock the Mouse loop { ;if greater than 30 seconds idle the sleep to save CPU cycles if A_TimeIdle > 5000 { sleep, 500 } if breakloop=y break MouseGetPos, OutputVarX, OutputVarY, Win if OutputVarX > 145 { blockinput, on MouseMove, 145, %OutputVarY%, 0 sleep, 50 blockinput, off } if OutputVarX < 0 { blockinput, on MouseMove, 0, %OutputVarY%, 0 sleep, 50 blockinput, off } if OutputVarY > 96 { blockinput, on MouseMove, %OutputVarX%, 96, 0 sleep, 50 blockinput, off } if OutputVarY < 0 { blockinput, on MouseMove, %OutputVarX%, 0, 0 sleep, 50 blockinput, off } WinGetTitle, TitleUnderMouse, A if TitleUnderMouse <> Lock the Mouse break } return Free: blockinput, Mouse gui, submit, nohide ControlSetText, Edit1, , Lock the Mouse if GuessedPassword = %Password% { GuiControl, Enable, Lock GuiControl, Disable, Release breakloop=y GuiControl, Disable, Edit1 } else { ControlSetText, Static1, Incorrect Password, Lock the Mouse sleep, 500 ControlSetText, Static1, Enter Password below, Lock the Mouse incorrectpasswords+=1 } return ^x:: Exitapp !Tab:: !F4:: LWin:: RWin:: Appskey:: return