Blocking Input Without Admin

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Voluntondile

Blocking Input Without Admin

17 Feb 2018, 13:33

Hi,

I've read dozens of threads looking for a way to block keyboard input without an administrator account with no luck. What I have is a script that bounces between 3 difference windows, sending keystrokes to the windows like ^c, ^v, c, {tab}, and a couple others. I tried the below but unfortunately it seems to block the script from using those keys also. I just want to stop the user from sending any keystrokes that would throw off the script from where it is (one of the files is an Excel file).

What I've tried:

Code: Select all

Input, Keys, T1, {Esc}
If (ErrorLevel = "Match")
	Send {%Keys% Down}
Return
Was also looking to have Esc as the escape key.

Thanks in advance! Appreciate any ideas.
Rohwedder
Posts: 7644
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Blocking Input Without Admin

18 Feb 2018, 01:11

Hallo,
try:

Code: Select all

#Persistent
Loop
{
	Input, Keys, IL1, {Esc}{Left}{Right}{Up}{Down} ;EndKeys are not blocked
	If InStr(ErrorLevel,"EndKey")
		Keys := SubStr(ErrorLevel,8)
	Send {%Keys%}
}
Return
q::Send, ^a ;also will not be blocked
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Blocking Input Without Admin

18 Feb 2018, 07:26

I don't know if you can check if current user is admin, but you can check if the script was ran as one: A_IsAdmin
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
Voluntondile

Re: Blocking Input Without Admin

18 Feb 2018, 09:42

Thanks Rohwedder. That seems to mostly do what I need however it also seems to be blocking clicks, which my script needs. Do you know how I would correct that?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: hedehede81, OrangeCat and 297 guests