It isn't foolproof. Ctrl+Alt+Delete is probably still going to work. I don't think there is any particular way to prevent that, or interacting with it.
I did find that if you use Ctrl+Alt+Delete, Task Manager can be brought up and interacted with. Then AHK can be shut down. If you run the script as administrator, it stops that.
However, I don't know how you would exit the script then. Using a single hotkey like the following script worked for me, but I'd imagine you'd like to have a combination hotkey or even a password to enter... I suppose that you can parse the v string for the value of the password and Exit the App, like this:
Code: Select all
password:="unlock"
Loop {
Input,v,,{PGDN}{PGUP}
If InStr(v,password)
ExitApp
If InStr(ErrorLevel,"EndKey")
Send % "{" SubStr(ErrorLevel,8) "}"
}
LButton::
MButton::
RButton::
Just tested that, and it seems to work. Type the password in quotes and that is what needs to be typed (at any point in time) before a PgUp or PgDn is sent to unlock it.