Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello,

Is there like a way that I can turn Input devices (Keyboard/Mouse) OFF on a keydown event excluding one Key like for example (I hit "F11", all Mouse & keyboard keys are disabled excluding "F10", which I use to turn them all back on.

Awaiting your Ideas,
Regards,
Safi
Posted

This is absolutely impossible, for example, because there is no a way to disable Ctrl+Alt+Delete — the system won't let it no matter what you do.

I'm not sure that global disable of anything else is possible, but you should not try to disrupt OS that much. The whole idea is bad.

Unfortunately, you did not share you ultimate purpose. You should always start with it. So, it's hard to advise anything else, but maybe what you want is the "Kiosk mode"? Please see:
Running a Web Site in Kiosk Mode with C#[^],
c# program ctrl-alt-del screen windows 7[^].

—SA
 
Share this answer
 
Hi Safi,

Assuming that you are trying to do this for your application only, why not just have a bool in your code that is something like AcceptInput. Then, detect the F11 key and set AcceptInput to false. If you detect the F10 key, set it to true. Finally, wrap all your other keyboard/mouse input handling code in an if block that tests whether AcceptInput is true. If it is, handle the input as normal, if it isn't, just move ignore.

If, however, you are trying to block all inputs for all applications, then I'm not sure that it is even possible, at least I certainly hope it isn't!

Hope this helps,
Ed
 
Share this answer
 
Comments
NeptuneHACK! 5-Feb-12 12:18pm    
I want to block all input globally, and at the same time be able to enable it in a specific keystroke.
Anyways thanks.
None of these are the solution I seek, I wish to lock my keyboard keys globally, I have a GlobalHook that listens to my keystrokes, and I want to make a (IF) block that activates when a certain keyUp event happens, and deactivate when another keyUp event accords, it's really important, and I assure you I'm not gonna abuse such knowledge, I'm sure it's possible, just cannot remember the method.

Thank you!
Safi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900