views:

1404

answers:

1

I'm looking to create a small C# application that will either run as a daemon or sit in the taskbar, and wait for a specific keypress. When the expected keypress is encountered, I'll perform some actions.

This is going to be used primarily for quick-posting of data to a web-service I'm writing. I've looked around the net for a while, but my search terms have been too vague, and I haven't come across any concrete examples or guides.

Thanks,

Mike Trpcic

+2  A: 

I came across this on CodeProject. It'll capture keystrokes while it's not focused. CodeProject: A Simple C# Global Low Level Keyboard Hook

statenjason
Thanks for this, it looks like it can do exactly what I need. Any idea if this is capable of binding key combinations (e.g. CTRL+Space)?
Mike Trpcic
The KeyEventArgs contains boolean properties to check if shift, alt, and control are pressed. So yes, I believe it would be pretty simple to implement key combinations.
statenjason