Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Day,

The OnKeyPress event for my application is working OK but when my application window lost the focus, this event doesn't work anymore.

Is there anyway to keep onKeyPress event for my application working regardless where the focus is?

Thanks and your help is appreciated.
Posted
Updated 17-Feb-11 2:14am
v2

1 solution

If your application lost the focus, you usually don't get the key press events. That is standard windows behaviour. If you want to process keyboard events nontheless, have a look at this article:
Processing Global Mouse and Keyboard Hooks in C#[^]
 
Share this answer
 
Comments
Espen Harlinn 20-Feb-11 9:28am    
That's usually the best way to do it, my 5

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900