AlphaS Posted May 27, 2006 Share Posted May 27, 2006 Hey All, I am just wondering (And I have searched the forums but to no avail) is there a way to block all keyboard input but not Mouse movement. Reason being Is possibly using a mouse key to turn on and off the keyboard lock. IF that is not possible... Is there a way to lock ALL KEYS except two keys that lock and unlock the keyboard. Yes I am aware of BlockInput, No it does not perform the actions I require, No it does not block the keyboard only, No Its not what I am looking for, Yes I've already tried playing around with it . Thanks! Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 27, 2006 Share Posted May 27, 2006 Try this method.. unfortunetly autoit can only have at most 64 hotkeys.. $keys = StringSplit("a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|" & _ "0|1|2|3|4|5|6|7|8|9|", "|") For $i = 1 to $keys[0] HotKeySet($keys[$i], "Stop") Next While 1 sleep(1000) WEnd Func Stop() ;blocks numbers letters EndFunc Link to comment Share on other sites More sharing options...
Wise1 Posted April 20, 2007 Share Posted April 20, 2007 Try this method.. unfortunetly autoit can only have at most 64 hotkeys.. $keys = StringSplit("a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|" & _ "0|1|2|3|4|5|6|7|8|9|", "|") For $i = 1 to $keys[0] HotKeySet($keys[$i], "Stop") Next While 1 sleep(1000) WEnd Func Stop() ;blocks numbers letters EndFunc How would you set a "back out key" ie: setup of a program jammed and you would like the user to press for ie: the letter Z whch will end the keyboard locking loop and allow full functionality again, i have messed around with bits and pieces of code to see if i can get it with no luck just yet Tim Link to comment Share on other sites More sharing options...
xcal Posted April 20, 2007 Share Posted April 20, 2007 (edited) #include <misc.au3> $keys = StringSplit("a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|" & _ "0|1|2|3|4|5|6|7|8|9", "|") For $i = 1 To $keys[0] HotKeySet($keys[$i], "Stop") Next While 1 Sleep(1000) If _IsPressed('5a') Then $init = TimerInit() Do Sleep(100) Until Not _IsPressed('5a') If TimerDiff($init) / 1000 > 5 Then ; holding 'z' for 5 seconds unlocks the keyboard For $i = 1 To $keys[0] HotKeySet($keys[$i]) Next EndIf EndIf WEnd Func Stop() ;blocks numbers letters EndFunc edit - moved the unlock in to the keep alive loop Edited April 20, 2007 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now