Camilo Posted July 2, 2007 Posted July 2, 2007 Hi everybody, I'm trying to figure out how to disable all the keys of the PC letting only the spacebar working. I would like my baby (he is 18 months old) to run his program by pressing the space key without doing anything else. It would be something like: CODEWhile 1 Blockinput(1) While 1 If _IsPressed("20") Then ExitLoop EndIf WEnd ; Here is the program for my baby Wend The problem is that Blockinput doesn't let the _IsPressed function to work. Does anybody have an idea? Thanks Camilo
herewasplato Posted July 2, 2007 Posted July 2, 2007 Welcome to the forum and congrats on the baby. Try this:For $i = 33 To 127 HotKeySet(Chr($i), "_dummy") Next While 1 Sleep(999) WEnd Func _dummy() EndFunc [size="1"][font="Arial"].[u].[/u][/font][/size]
herewasplato Posted July 2, 2007 Posted July 2, 2007 I'll not attempt to edit my code above due to some forum bugs atm - but here is a version with a Func that uses the spacebar:For $i = 33 To 127 HotKeySet(Chr($i), "_dummy") Next HotKeySet(Chr(32), "_DoStuff") ;space While 1 Sleep(999) WEnd Func _dummy() EndFunc Func _DoStuff() ; Here is the program for my baby EndFuncor you could use If @HotKeyPressed and exitloop [size="1"][font="Arial"].[u].[/u][/font][/size]
Valuater Posted July 2, 2007 Posted July 2, 2007 (edited) being you are working with a "real" youngster... it may be more to your benefit to physicall cover the keyboard with a firm plastic ( like what sometimes covers a new keyboard ) just cut-out the space bar That way any spills, sticky fingers, etc... won't bother your keyboard just a thought good luck 8) Edited July 2, 2007 by Valuater
herewasplato Posted July 2, 2007 Posted July 2, 2007 ...and hide the mouse :-) [size="1"][font="Arial"].[u].[/u][/font][/size]
Camilo Posted July 2, 2007 Author Posted July 2, 2007 Thanks for your replies, herewasplato your script is the one I needed; thank you
herewasplato Posted July 2, 2007 Posted July 2, 2007 (edited) You are welcome - but it is just an example. There are more keys that will need to be assigned to that dummy UDF in order for this to work for you. Check the list of ASCII characters in the help file. Edit: along with the "send key list" Edited July 2, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
kp3 Posted July 2, 2007 Posted July 2, 2007 I just wanted to tell u that that was probably the most annoying script ever made ! xD It stops my mouse! I had to restart my computer xD How are u supposed to shut it down? [s]My scripts =)Password protect process (with tray menu lol)Clickous meousDisable ctrl+alt+del and password protect folder...Andous herous lolKp3s security center v.1Click me[/s]Ok... You shouldnt use annyone of them cuz they use alot of memory and contain alot of errors and stuff.. I was a n00b :P Ignore it... And if u for some reason want to use them... Watch out for my realy bad spelling :I
herewasplato Posted July 2, 2007 Posted July 2, 2007 (edited) I just wanted to tell u that that was probably the most annoying script ever made ! xD It stops my mouse! I had to restart my computer xD How are u supposed to shut it down?If you are making this comment about the code that the OP posted - then use ctrl-alt-del and then cancel that screen - that should reset the effects of the blockinput function.If you are talking about the code that I posted to this thread - it should not affect the mouse.Edit - now I see that the blockinput is in a While/Wend loop - yep, restart will do it. Edited July 2, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
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