Support for assigning any key as a hotkey; minor refactoring

This commit is contained in:
Leon V
2015-06-07 13:45:06 +10:00
parent dcd20f42b9
commit 825128b630
5 changed files with 100 additions and 103 deletions

View File

@@ -331,6 +331,12 @@ namespace Wox
public void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
{
var hotkey = new HotkeyModel(hotkeyStr);
SetHotkey(hotkey, action);
}
public void SetHotkey(HotkeyModel hotkey, EventHandler<HotkeyEventArgs> action)
{
string hotkeyStr = hotkey.ToString();
try
{
HotkeyManager.Current.AddOrReplace(hotkeyStr, hotkey.CharKey, hotkey.ModifierKeys, action);