Download Now

    Reference THotkeyCapture

    Declared in Codebot.Input.Hotkeys.pas on line 45

    THotkeyCapture registers system wide hotkeys which work even when the program does not have focus. Use the HotkeyCapture function to access it.
      THotkeyCapture = class
      protected
        { Return the index of a registered hotkey or -1 if it is not registered }
        function FindHotkey(Key: Word; ShiftState: TShiftState): Integer;
        { Register a hotkey with the operating system }
        procedure DoRegister(Key: Word; ShiftState: TShiftState); virtual; abstract;
        { Unregister a hotkey with the operating system }
        procedure DoUnregister(Key: Word; ShiftState: TShiftState); virtual; abstract;
        { The registered hotkeys }
        property Notifiers[Index: Integer]: THotkeyNotify read GetNotifier; default;
        { The number of registered hotkeys }
        property Count: Integer read GetCount;
      public
        { Unregister all hotkeys and destroy the object }
        destructor Destroy; override;
        { Register a hotkey returning false if it is invalid or already registered }
        function RegisterNotify(Key: Word; ShiftState: TShiftState; Notify: TKeyNotifyEvent): Boolean;
        { Unregister a hotkey returning false if it was not registered }
        function UnregisterNotify(Key: Word; ShiftState: TShiftState): Boolean;
      end;

    See also