Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Confuse about BlockInput



  • Please log in to reply
3 replies to this topic
johnhill
  • Members
  • 180 posts
  • Last active: Jan 03 2018 02:49 AM
  • Joined: 25 Sep 2014

Hi,

 

It seem like BlockInput doesn't work. My mouse and keyboard still working. Then I tried BlockInput, MouseMove. It works and only for mouse. BlockInput, SendAndMouse not work also.

 

 

How do I block mouse and keyboard input?

 

I am using Windows 10.

#NoEnv  
#Warn
SendMode Input
SetWorkingDir %A_ScriptDir%  
SetBatchLines -1   
#SingleInstance Force
CoordMode, Mouse, Screen
#Persistent

Please help. Thank you.



Jack Dunning
  • Members
  • 217 posts
  • Last active: Nov 11 2015 08:40 PM
  • Joined: 08 Apr 2013

Per the documentation, it looks like BlockInput, On will block both mouse and keyboard. BlockInput, Off reverses it.


I currently do a regular blog for AutoHotkey beginners and have posted a number of AutoHotkey help pages at ComputorEdge.com. As I learn, I pass it on.

 

AutoHotkey scripts and apps for beginners and more ideas.


Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
✓  Best Answer

If UAC is enabled, BlockInput() apparently only works if the process is elevated; i.e. running as admin or with EnableUIAccess.

 

BlockInput Mouse/MouseMove is actually a totally different thing to BlockInput(); when enabled, AutoHotkey's mouse hook blocks mouse events, the same way that it does when you define a mouse hotkey.

 

N.B. Setting UAC to "Never notify me" on Windows 8 and later does not disable UAC.



johnhill
  • Members
  • 180 posts
  • Last active: Jan 03 2018 02:49 AM
  • Joined: 25 Sep 2014

Thank you, Jack.

 

 

 

If UAC is enabled, BlockInput() apparently only works if the process is elevated; i.e. running as admin or with EnableUIAccess.

 

BlockInput Mouse/MouseMove is actually a totally different thing to BlockInput(); when enabled, AutoHotkey's mouse hook blocks mouse events, the same way that it does when you define a mouse hotkey.

 

N.B. Setting UAC to "Never notify me" on Windows 8 and later does not disable UAC.

 

Just test with Run Administrator. The BlockInput is working.

 

Thank you, Lexikos.