Skip to content
This repository was archived by the owner on Nov 26, 2022. It is now read-only.

WinLib.HotKeyMonitor

Andrew Lambert edited this page Jul 23, 2014 · 3 revisions

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

Clone this wiki locally