Volume Control
Application-specific hotkeys for Windows
|
A hotkey that executes an action when pressed. More...
Public Member Functions | |
Hotkey (string name, EFriendlyKey key, EModifierKey modifiers, bool isRegistered, HotkeyActionInstance actionInstance) | |
Creates a new Hotkey instance with the specified parameters. More... | |
Hotkey (string name, EFriendlyKey key, EModifierKey modifiers, bool isRegistered) | |
Hotkey (EFriendlyKey key, EModifierKey modifiers, bool isRegistered, HotkeyActionInstance actionInstance) | |
Hotkey (EFriendlyKey key, EModifierKey modifiers, bool isRegistered) | |
void | GetNewID () |
Gets a new ID from the WindowsHotkeyAPI. More... | |
void | Dispose () |
Cleans up the Hotkey instance by unregistering it, if necessary. More... | |
Protected Member Functions | |
void | NotifyPropertyChanged ([CallerMemberName] string propertyName="") |
Triggers the PropertyChanged event. More... | |
virtual bool | RegisterHotkey () |
Registers the hotkey with the Windows API. More... | |
virtual bool | UnregisterHotkey () |
Unregisters the hotkey with the Windows API. More... | |
Properties | |
ushort | ID [get] |
string | Name [get, set] |
EFriendlyKey | Key [get, set] |
EModifierKey | Modifiers [get, set] |
bool | Alt [get, set] |
bool | Shift [get, set] |
bool | Ctrl [get, set] |
bool | Win [get, set] |
bool | NoRepeat [get, set] |
HwndSourceHook | MessageHook [get] |
bool | IsRegistered [get, set] |
HotkeyActionInstance? | Action [get, set] |
Properties inherited from VolumeControl.Core.Input.IHotkey | |
string | Name [get, set] |
Gets or sets the friendly name of this hotkey. More... | |
ushort | ID [get] |
Gets the ID number of this hotkey. More... | |
EFriendlyKey | Key [get, set] |
Gets or sets the main key for this hotkey. More... | |
EModifierKey | Modifiers [get, set] |
Gets or sets the modifier keys for this hotkey. More... | |
bool | Alt [get, set] |
Gets or sets whether the Alt modifier key is enabled. More... | |
bool | Shift [get, set] |
Gets or sets whether the Shift modifier key is enabled. More... | |
bool | Ctrl [get, set] |
Gets or sets whether the Ctrl modifier key is enabled. More... | |
bool | Win [get, set] |
Gets or sets whether the Win modifier key is enabled. More... | |
bool | NoRepeat [get, set] |
Gets or sets whether NoRepeat is enabled. More... | |
bool | IsRegistered [get, set] |
Gets or sets whether this hotkey is registered with the Win32 API. More... | |
HotkeyActionInstance? | Action [get, set] |
Gets or sets the action that this hotkey triggers when pressed. More... | |
Events | |
HotkeyPressedEventHandler? | Pressed |
Occurs when the hotkey was pressed, after the Action has been triggered. More... | |
PropertyChangedEventHandler? | PropertyChanged |
HotkeyRegisteringEventHandler? | Registering |
EventHandler? | Registered |
HotkeyRegisteringEventHandler? | Unregistering |
EventHandler? | Unregistered |
Events inherited from VolumeControl.Core.Input.IHotkey | |
HotkeyPressedEventHandler? | Pressed |
Occurs when the hotkey combination was pressed. More... | |
HotkeyRegisteringEventHandler? | Registering |
Occurs when the hotkey is about to be registered for any reason. More... | |
EventHandler? | Registered |
Occurs when the hotkey has been registered for any reason. More... | |
HotkeyRegisteringEventHandler? | Unregistering |
Occurs when the hotkey is about to be unregistered for any reason. More... | |
EventHandler? | Unregistered |
Occurs when the hotkey has been unregistered for any reason. More... | |
A hotkey that executes an action when pressed.
VolumeControl.Core.Input.Hotkey.Hotkey | ( | string | name, |
EFriendlyKey | key, | ||
EModifierKey | modifiers, | ||
bool | isRegistered, | ||
HotkeyActionInstance | actionInstance | ||
) |
Creates a new Hotkey instance with the specified parameters.
name | The name of the hotkey. |
key | The primary key of the hotkey combination. |
modifiers | The modifier keys of the hotkey combination. |
isRegistered | The registration state of the hotkey. |
actionInstance | The action to trigger when the hotkey is pressed. |
References VolumeControl.Core.Input.Hotkey.Action, VolumeControl.Core.Input.Hotkey.ID, VolumeControl.Core.Input.Hotkey.IsRegistered, VolumeControl.Core.Input.Hotkey.Key, VolumeControl.Core.Input.Hotkey.Modifiers, and VolumeControl.Core.Input.Hotkey.Name.
void VolumeControl.Core.Input.Hotkey.Dispose | ( | ) |
Cleans up the Hotkey instance by unregistering it, if necessary.
Referenced by VolumeControl.Core.Input.HotkeyManager.RemoveHotkey().
void VolumeControl.Core.Input.Hotkey.GetNewID | ( | ) |
Gets a new ID from the WindowsHotkeyAPI.
This method automatically unregisters & reregisters the hotkey when called.
References VolumeControl.Core.Input.Hotkey.ID, and VolumeControl.Core.Input.Hotkey.IsRegistered.
|
protected |
Triggers the PropertyChanged event.
propertyName | The name of the property that was changed. |
|
protectedvirtual |
Registers the hotkey with the Windows API.
This can be overridden in derived classes to change how the hotkey is registered. This method is only called after the Registering event returns without being set as handled.
true
when successful; otherwise false
.Referenced by VolumeControl.Core.Input.Hotkey.UnregisterHotkey().
|
protectedvirtual |
Unregisters the hotkey with the Windows API.
This can be overridden in derived classes to change how the hotkey is unregistered.
true
when successful; otherwise false
.References VolumeControl.Core.Input.Hotkey.IsRegistered, and VolumeControl.Core.Input.Hotkey.RegisterHotkey().
HotkeyPressedEventHandler? VolumeControl.Core.Input.Hotkey.Pressed |
Occurs when the hotkey was pressed, after the Action has been triggered.