Skip to content

Commit 874196e

Browse files
committed
fix: remove default behavior: auto-add ctrl+hotkey to launch new app
close #1
1 parent 34ac4a0 commit 874196e

File tree

3 files changed

+36
-24
lines changed

3 files changed

+36
-24
lines changed

README-zh.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,15 @@ disable=true
7979
8080
```
8181

82+
常用的快捷键符号:
83+
84+
- `#`:Win键
85+
- `!`:Alt键
86+
- `^`:Ctrl键
87+
- `+`:Shift键
88+
89+
更多快捷键符号请参考 [Autohotkey Symbols](https://www.autohotkey.com/docs/v2/Hotkeys.htm#Symbols).
90+
8291
### 3.2. 开机自启动
8392

8493
 最简单的方法是在 `Startup(启动)` 文件夹中放置脚本文件的快捷方式.

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ launchPaths=notepad.exe|C:\Windows\System32\notepad.exe
7676
disable=true
7777
```
7878

79+
You can use the following modifier symbols to define hotkeys:
80+
81+
| Symbol | Description | Example |
82+
| :----: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
83+
| # | Win (Windows logo key). Hotkeys that include Win (e.g. #a) will wait for Win to be released before sending any text containing an L keystroke. This prevents usages of [Send](https://www.autohotkey.com/docs/v2/lib/Send.htm) within such a hotkey from locking the PC. This behavior applies to all sending modes except [SendPlay](https://www.autohotkey.com/docs/v2/lib/Send.htm#SendPlayDetail) (which doesn't need it), [blind mode](https://www.autohotkey.com/docs/v2/lib/Send.htm#blind) and [text mode](https://www.autohotkey.com/docs/v2/lib/Send.htm#SendText). | `#S`: Win+S |
84+
| ! | Alt **Note:** Pressing a hotkey which includes Alt may result in extra simulated keystrokes (Ctrl by default). See [A_MenuMaskKey](https://www.autohotkey.com/docs/v2/lib/A_MenuMaskKey.htm). | `!S`: Alt+S |
85+
| ^ | Ctrl | `^S`: Ctrl+S |
86+
| + | Shift | `^+S`: Ctrl+Shift+S |
87+
88+
For more hotkey symbol, see [Autohotkey Symbols](https://www.autohotkey.com/docs/v2/Hotkeys.htm#Symbols).
89+
7990
### 3.2. Auto-Start on Boot
8091

8192
The easiest method to enable auto-start is by placing a shortcut to the script in the `Startup` folder.

winguake.ahk

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ RegisterHotkeys() {
420420
try
421421
{
422422
Hotkey(appConfig.hotkey, ToggleApp.Bind(appKey))
423-
; 注册 Ctrl + 热键(如 Ctrl+F3)
424-
Hotkey("^" . appConfig.hotkey, LaunchApp.Bind(appKey))
425423
}
426424
catch as err {
427425
ShowNotification("Failed to register hotkey: " . appConfig.hotkey . " - " . err.message)
@@ -610,9 +608,9 @@ LaunchApp(appKey, *) {
610608
}
611609

612610
; 显示通知
613-
ShowNotification(message) {
611+
ShowNotification(message, delay := 1500) {
614612
ToolTip(message)
615-
SetTimer(() => ToolTip(), -1000) ; 1秒后自动消失
613+
SetTimer(() => ToolTip(), -delay)
616614
}
617615

618616
; ==================== 扩展功能 ====================
@@ -653,8 +651,6 @@ ShowAppStatus() {
653651
}
654652
}
655653

656-
status .= "`nPress F12 to refresh status`nMulti-window applications support cycle activation"
657-
658654
MsgBox(status, "Application Status - " . SCRIPT_NAME, 0x1000)
659655
}
660656

@@ -673,7 +669,6 @@ CreateTrayMenu() {
673669
continue
674670
}
675671
A_TrayMenu.Add("Toggle " . appConfig.name . " (" . appConfig.hotkey . ")", ToggleApp.Bind(appKey))
676-
A_TrayMenu.Add("Start new " . appConfig.name . " (Ctrl+" . appConfig.hotkey . ")", LaunchApp.Bind(appKey))
677672
}
678673

679674
A_TrayMenu.Add() ; 分隔线
@@ -704,28 +699,24 @@ ShowHelp(*) {
704699
helpText .= "
705700
(
706701

707-
Hotkey Description:
708-
Function Key - Toggle corresponding application display/hide
709-
Ctrl+Function Key - Start a new application instance
710-
F12 - Show all application status
711-
Ctrl+Alt+H - Show this help
712-
Ctrl+Alt+Q - Exit script
702+
Hotkey Description:
703+
Hotkey - Toggle corresponding application display/hide/launch
713704

714-
Function Description:
715-
• The first press of the function key will start the corresponding application
705+
Function Description:
706+
• The first press of the hotkey will start the corresponding application
716707
Single window: Minimize when active, activate when inactive
717708
Multi-window: Cycle through each window, minimize all when on the last window
718-
• Support for multi-path automatic detection startup
719709
• Display window titles and numbers for easy identification
720710

721-
Multi-window cycle logic:
711+
Multi-window cycle logic:
722712
1. First press: Activate the first window
723713
2. Continue pressing: Activate subsequent windows in turn
724714
3. Last window: Minimize all windows
725715
4. Press again: Start again from the first window
726716

727-
Adding new applications:
728-
Simply add new application configurations to the Apps section at the beginning of the script or in the config file!
717+
Adding new applications:
718+
Simply add new application configurations to the Apps section at the beginning of the script!
719+
You can also modify configuration file which can be located by right-clicking the 'Open Configuration file'.
729720

730721
Right-clicking the system tray icon provides access to more features.
731722
)"
@@ -742,10 +733,11 @@ GenerateStartupNotification()
742733
GenerateStartupNotification() {
743734
appList := ""
744735
for appKey, appConfig in Apps {
745-
if (appList != "")
746-
appList .= ", "
747-
appList .= appConfig.hotkey . ":" . appConfig.name
736+
if IsDisabled(appConfig) {
737+
continue
738+
}
739+
appList .= "- " . appConfig.hotkey . ":" . appConfig.name . "`n"
748740
}
749741

750-
ShowNotification(SCRIPT_NAME . " is running - " . appList)
751-
}
742+
MsgBox(SCRIPT_NAME . " is running `n`n" . appList, "Startup Notification - " . SCRIPT_NAME, "T15")
743+
}

0 commit comments

Comments
 (0)