add command option -hotkey to allow customization, such as -hotkey "Q", change default hotkey to (Alt+)W

This commit is contained in:
Kang Yu 2024-04-13 15:05:30 -07:00
parent 307963f851
commit 466517da1e
3 changed files with 32 additions and 17 deletions

View file

@ -71,6 +71,7 @@ namespace PersistentWindows.SystrayShell
bool legacy_icon = false;
bool waiting_taskbar = false;
bool hotkey_window = true;
uint hotkey = 'W'; //Alt + W
foreach (var arg in args)
{
@ -118,6 +119,11 @@ namespace PersistentWindows.SystrayShell
pwp.SetIgnoreProcess(arg);
continue;
}
else if (hotkey == 1)
{
hotkey = arg[0];
continue;
}
switch(arg)
{
@ -197,6 +203,9 @@ namespace PersistentWindows.SystrayShell
case "-hotkey_window=0":
hotkey_window = false;
break;
case "-hotkey":
hotkey = 1;
break;
case "-prompt_session_restore":
prompt_session_restore = true;
break;
@ -345,7 +354,7 @@ namespace PersistentWindows.SystrayShell
pwp.SetIgnoreProcess(ignore_process);
if (hotkey_window)
HotKeyForm.Start();
HotKeyForm.Start(hotkey);
if (!pwp.Start(auto_restore_from_db_at_startup))
{