Hi,
I was looking for a way to lock or unlock the keyboard with a combination of keys and/or with a press of a switch button using the touchpad/mouse/touchscreen. My objective is to use my Active Pen resting my arm on the keyboard.
I stumbled upon:
https://autohotkey.com/board/topic/2123 ... not-mouse/ - page 2 Lexicos code.
https://www.howtogeek.com/howto/11570/d ... n-windows/ - modified version
which locks the keyboard, but fails to unlock it. I'm on Windows 10.
I'm very new to AutoHotkey (since this morning). I've been study that script very hard since this morning without finding a way to fix it. Please help me.
lock/unlock the Keyboard
-
- Posts: 11
- Joined: 19 Jan 2018, 12:57
- divanebaba
- Posts: 805
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: lock/unlock the Keyboard
You have to use BlockInput on and BlockInput off.
As the Keyboard is blocked, it is the best to even start for safety a timer to execute BlockInput off, because if your code stucks, your keyboard could stay blocked until new boot or similar.
The timer will prevent being unable to unblock the keyboard.
EDIT: I've problems with BlockInput on. It does not works. I can't block my keyboard. It was not a problem in the past.
SOLUTION: Help-file says
Here a sample for a selfunblocking code:
As the Keyboard is blocked, it is the best to even start for safety a timer to execute BlockInput off, because if your code stucks, your keyboard could stay blocked until new boot or similar.
The timer will prevent being unable to unblock the keyboard.
EDIT: I've problems with BlockInput on. It does not works. I can't block my keyboard. It was not a problem in the past.
SOLUTION: Help-file says
Now it worksNote: Mode 1 and 2 might have no effect if UAC is enabled and the script has not been run as administrator. For more information, refer to the FAQ.
Here a sample for a selfunblocking code:
Code: Select all
F7:: ; press F7 to start this script
Blockinput, on ; User input is blocked - try to move mouse to test
SetTimer, UnBlocker, 5000 ; set the label UnBlocker as timer with 5 sec repeat time.
return
UnBlocker:
Blockinput, off ; selfexplaining
SetTimer, UnBlocker, off ; deactivates himself
return
Einfach nur ein toller Typ.
Who is online
Users browsing this forum: Anput, Marium0505, Nerafius and 198 guests