mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 11:10:23 +12:00
Register failed hotkeys on hotkey settings form startup
This commit is contained in:
parent
82449c643f
commit
c4dde0c3a0
|
@ -64,6 +64,7 @@ public void PrepareHotkeys(HotkeyManager hotkeyManager)
|
|||
{
|
||||
manager = hotkeyManager;
|
||||
manager.HotkeysToggledTrigger += HandleHotkeysToggle;
|
||||
manager.RegisterFailedHotkeys();
|
||||
|
||||
AddControls();
|
||||
}
|
||||
|
@ -113,21 +114,12 @@ private void UpdateHotkeyStatus()
|
|||
}
|
||||
}
|
||||
|
||||
private void RegisterFailedHotkeys()
|
||||
{
|
||||
foreach (HotkeySettings hotkeySettings in manager.Hotkeys.Where(x => x.HotkeyInfo.Status == HotkeyStatus.Failed))
|
||||
{
|
||||
manager.RegisterHotkey(hotkeySettings);
|
||||
}
|
||||
|
||||
UpdateHotkeyStatus();
|
||||
}
|
||||
|
||||
private void control_HotkeyChanged(object sender, EventArgs e)
|
||||
{
|
||||
HotkeySelectionControl control = (HotkeySelectionControl)sender;
|
||||
manager.RegisterHotkey(control.HotkeySettings);
|
||||
RegisterFailedHotkeys();
|
||||
manager.RegisterFailedHotkeys();
|
||||
UpdateHotkeyStatus();
|
||||
}
|
||||
|
||||
private HotkeySelectionControl AddHotkeySelectionControl(HotkeySettings hotkeySettings)
|
||||
|
|
|
@ -127,6 +127,14 @@ public void RegisterAllHotkeys()
|
|||
}
|
||||
}
|
||||
|
||||
public void RegisterFailedHotkeys()
|
||||
{
|
||||
foreach (HotkeySettings hotkeySetting in Hotkeys.Where(x => x.HotkeyInfo.Status == HotkeyStatus.Failed))
|
||||
{
|
||||
RegisterHotkey(hotkeySetting);
|
||||
}
|
||||
}
|
||||
|
||||
public void UnregisterHotkey(HotkeySettings hotkeySetting, bool removeFromList = true)
|
||||
{
|
||||
if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Registered)
|
||||
|
|
Loading…
Reference in a new issue