Click here to Skip to main content
13,050,358 members (139,777 online)
Rate this:
Please Sign up or sign in to vote.

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,
Posted 5-Feb-12 4:14am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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[^].

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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,
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

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!

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 6 Feb 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100