Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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 5-Feb-12 5:14am
Rate this: bad
good
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[^].
 
—SA
  Permalink  
Rate this: bad
good
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,
Ed
  Permalink  
Comments
NeptuneHACK! at 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
good
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!
Safi
  Permalink  

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

  Print Answers RSS
0 Maciej Los 295
1 OriginalGriff 273
2 Aajmot Sk 234
3 Marcin Kozub 205
4 Richard MacCutchan 200
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 6 Feb 2012
Copyright © CodeProject, 1999-2014
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