WinLib.HotKeyMonitor - charonn0/WinLib GitHub Wiki

WinLib.HotKeyMonitor

##Class Declaration

    Global Class HotKeyMonitor
    Inherits WinLib.MessageMonitor

##Notes Inherits WinLib.MessageMonitor

This class allows you to detect specified keyboard shortcuts no matter what application has keyboard input.

For example:

 Dim hotkey As New HotKeyMonitor()
 Dim hotkeyID As Integer = HotKey.RegisterKey("a", MOD_CONTROL, MOD_ALT)

The above snippet would raise the HotKeyPressed event whenever the global hotkey combo Ctrl+Alt+a is pressed.

Each instance of the HotKeyMonitor class can handle an arbitrary number of hotkey combinations, each being uniquely identifiable by their hotkeyID number. A global hotkey combo can be registered to only one application at a time, and only the most recent application to register the combo will be notified.

If you no longer want to receive notifications for a particular HotKey, pass its ID number (the return value from RegisterKey) to the UnregisterKey method.

##Event Definitions

##Methods

##See also