Sign in to follow this  
Followers 0
Camilo

Block almost all user inputs

9 posts in this topic

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:

CODE
While 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

Share this post


Link to post
Share on other sites



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]

Share this post


Link to post
Share on other sites

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
EndFunc
or you could use If @HotKeyPressed and exitloop


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

...and hide the mouse :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks for your replies,

herewasplato your script is the one I needed; thank you

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (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 by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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
Sign in to follow this  
Followers 0