Search code examples
c#winformskeyboardblock

c# block only keyboard input


Possible Duplicate:
How can I block keyboard and mouse input in C#?

Under How can I block keyboard and mouse input in C#? there is a way how to block mouse and keyboard input in C#. Is there a way to lock only keyboard and allow mouse input?


Solution

  • The answer is already in the question you link to.

    This article: http://www.codeproject.com/KB/cs/globalhook.aspx

    shows the direction you need to head towards. Its called a low level hook. I'm not sure how his implementation exactly works but at the low level you have the option of passing on the message to other processes. You can choose not and this will prevent input travelling anywhere.

    I suggest downloading his code, examining his P/Invoke code and seeing if he passes up the option to pass on the input, if not, rewrite it so it does!

    Note: I believe CTRL+ALT+DELETE is still not "killable" using this method.