Jump to content

Hotkey to release a blockinput


 Share

Go to solution Solved by JohnOne,

Recommended Posts

Hi Everyone, 

I'm trying to find a way to assign a hotkey to stop a blockinput function, just in case anything goes wrong in my script.

I took a look here :

'?do=embed' frameborder='0' data-embedContent>>

I also did some tests but this UDF "only" allows me to exclude some keys whereas I need a simple hotkey, F1 for example, that will release the blockinput.

Maybe someone can give me a hand over here :)

Thanks in advance,

31290.

~~~ Doom Shall Never Die, Only The Players ~~~

Link to comment
Share on other sites

You do realize why it is a bad idea to want user input to to stop a function that blocks user input right?

If you are using BlockInput for any length of time where something might go wrong, you are probably using it foolishly to begin with too.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

You do realize why it is a bad idea to want user input to to stop a function that blocks user input right?

If you are using BlockInput for any length of time where something might go wrong, you are probably using it foolishly to begin with too.

 

Yes I realized that but this is a requirement from my bosses.

If anything goes wrong during the script execution, there's no way the users will have to reboot the computer to unlock mouse & keyboard.

That's why I have to find a way to create a rescue key.

~~~ Doom Shall Never Die, Only The Players ~~~

Link to comment
Share on other sites

Two way :

Hotckeyset ("{F10}","BlockinputOff")  

Func BlockinputOff ()

        BlockInput = 0

EndFunc

Or CTRL + ALT + SUPR

If you need a manual blockinput emergency shutoff both way are OK

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

well Ctrl-alt-del override blockinput in autoit anyway, or m'i wrong?

 

CTRL-ALT-DEL override blockinput as you said but as soon as I return to Windows or open Task Manager, the blockinput is back and you can't do anything.

 

Two way :

Hotckeyset ("{F10}","BlockinputOff")  

Func BlockinputOff ()

        BlockInput = 0

EndFunc

Or CTRL + ALT + SUPR

If you need a manual blockinput emergency shutoff both way are OK

 

Thanks, I'm gonna try and let you know :)

~~~ Doom Shall Never Die, Only The Players ~~~

Link to comment
Share on other sites

  • Solution

It does not work. how could it?

#RequireAdmin

HotKeySet("{F10}", "_Func")

BlockInput(1)

$timer = TimerInit()

While TimerDiff($timer) < 10000
    Sleep(10)
WEnd

Func _Func()
    BlockInput(0)
EndFunc

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...