Search code examples
.netvb.netkeypresskeyboard-hook

VB.NET Detecting Keypress While Minimized


I want to be able to detect when the user presses F10 or Ctrl+F10 outside of my program, and upon receiving the key press, it will send text to whatever they currently have selected (e.g. a text box). How can this be accomplished in the simplest way?


Solution

  • Use RegisterHotkey and not a keyboard hook to get a global hotkey.

    See one of my older answers on almost the same question: listen for a key when the application is not focused