Skip to content

Commit 86ab1f9

Browse files
FEATURE: support left click and double click on tray icons
1 parent f0783cc commit 86ab1f9

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

classes/TrayControl.ahk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ class TrayControl {
1515
return this.trayArray.MaxIndex()
1616
}
1717

18+
leftClick(windId) {
19+
this.click(windId, "L", false)
20+
}
21+
22+
doubleClick(windId) {
23+
this.click(windId, "L", true)
24+
}
25+
1826
rightClick(windId) {
1927
this.click(windId, "R", false)
2028
}

iSwitch.ahk

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ RefreshWindowList:
921921
}
922922

923923
if numwin = 1
924-
if autoactivateifonlyone = 1
924+
if autoactivateifonlyone = 1 and showTrayIcons != 1
925925
{
926926
; only autoactivate if the search string is not empty
927927
; otherwise the gui would close if only one windows is available
@@ -1110,7 +1110,11 @@ UpdateStatusBar:
11101110
}
11111111

11121112
if(autoactivateifonlyone = 1) {
1113-
newText = %newText% | Auto activate enabled
1113+
if(showTrayIcons = 1) {
1114+
newText = %newText% | Auto activate not supported for tray icons
1115+
} else {
1116+
newText = %newText% | Auto activate enabled
1117+
}
11141118
} else {
11151119
newText = %newText% | Auto activate disabled
11161120
}
@@ -1147,8 +1151,18 @@ ActivateWindow:
11471151

11481152

11491153
if(showTrayIcons) {
1150-
1151-
trayControl.rightClick(window_id)
1154+
GetKeyState, state, Ctrl
1155+
if (state = "D") {
1156+
GetKeyState, state, Alt
1157+
if (state = "D") {
1158+
trayControl.doubleClick(window_id)
1159+
} else {
1160+
trayControl.leftClick(window_id)
1161+
}
1162+
1163+
} else {
1164+
trayControl.rightClick(window_id)
1165+
}
11521166

11531167
Sleep, 200
11541168
Gui, Submit

0 commit comments

Comments
 (0)