Search code examples
programming-languageskeyboardhotkeyskeyhook

Programming a hotkey utility


I've got a project, where I need to use hotkeys, that would work globally through the whole Windows OS. Now, from my knowledge I only know how to read Key events on current form. How would I go about programming a hotkey utility? And what would be the best language for it?

Thanks


Solution

  • For C#/.Net and a low-level hook (using Interops), have a look at Stephen Toubs example here (complete with source):

    Low-Level Keyboard Hook in C#

    For a more complete example (also C#/.Net and Interops), but with everthing neatly contained in a separate class, including trapping key presses using normal Events on the client side, check this out (the link to the actual source is in the blog text, a bit tricky to spot):

    Global hotkeys with .NET