Alex

Alex

  • NA
  • 6
  • 0

C# Catch a Key and Suppress it?

Mar 3 2009 10:29 AM
Hello, as all my searches have come up dry, and I've gotten a bit rusty with c# in the last couple months, I decided to ask this here.

Basically I need to catch any and all key presses (shift, alt, control, Letters, Numbers, as well as other function keys on a keyboard) record and suppress them before they get to whatever application is currently in the forground while the variable is set to true. Basically one key on the keyboard will toggle the variable between true and false, but the real issue is Getting the key presses and suppressing them. I know KeyEventArgs and SuppressKeyPress come into play, but due to the nature of what I need, the majority of the details on it have been hidden. Any assistance would be greatly appreciated.

Answers (5)