1
votes

I was wondering if there was a way to detect if key strokes are from the keyboard or a SendKeys.Send call.

I would like to block specific SendKeys.Send keys but if those keys are directly from the keyboard then let them go.

1

1 Answers

0
votes

Create a console application and run the code located here: http://blogs.msdn.com/b/toub/archive/2006/05/03/589423.aspx

Create a second application that will fire SendKeys.Send when you click a button. You will notice that the first console application detects key strokes from the keyboard but not keys from SendKeys.Send

I'm sure you could you use the code from the article to detect if the keystroke came from the keyboard or SendKeys.Send