Question

An example of an app that does this is Enso, it pops up when you press the caps lock.

Was it helpful?

Solution

You can act on global hotkeys by calling the winapi function RegisterHotKey. Also see http://www.codeproject.com/KB/vb/mclhotkeynet.aspx and http://www.codeproject.com/KB/miscctrl/systemhotkey.aspx for example. You can not use all key combination as hotkeys. For those that don't work you might try a global keyboard hook (SetWindowsHookEx)

OTHER TIPS

You need to install a hook in user32.dll. Lookup the Win32-API call SetWindowsHookEx. You can call it from C# via the stuff in System.Runtime.InteropServices.

This article discusses the topic nicely.

Edit: Lars Truijens answer looks like a nicer approach actually.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top