Skip to content

Commit 93b8fc7

Browse files
CONTENT: rename to fast_keyboard_window_switcher
1 parent b881e74 commit 93b8fc7

10 files changed

Lines changed: 88 additions & 61 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# iSwitch
1+
# Fast Keyboard Windows Switcher
22

3-
Switch fast between open windows (Windows tool)
3+
Switch fast between open windows (for Windows 10 / 11)
44

55
## Installation
66

build_release.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
"c:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in iswitch.ahk
1+
mkdir bin
2+
"c:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in fast_keyboard_window_switcher.ahk
23

classes/Settings.ahk

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
; MyClass.ahk
22
class Settings {
33

4+
; 0 = all windows
5+
; 1 = tray icons
6+
; 2 = command list
7+
_contentTypeAllWindows := 0
8+
_contentTypeTrayIcons := 1
9+
_contentTypeCommands := 2
410

511
DEFAULT_GUI_SPACING_HORIZONTAL := 20
612
DEFAULT_GUI_SPACING_VERTICAL := 20
@@ -12,6 +18,18 @@ class Settings {
1218
__New() {
1319
}
1420

21+
contentTypeAllWindows() {
22+
return this._contentTypeAllWindows
23+
}
24+
25+
contentTypeTrayIcons() {
26+
return this._contentTypeTrayIcons
27+
}
28+
29+
contentTypeCommands() {
30+
return this._contentTypeCommands
31+
}
32+
1533
defaultGuiSpacingHorizontal() {
1634
return this.DEFAULT_GUI_SPACING_HORIZONTAL
1735
}
@@ -37,7 +55,7 @@ class Settings {
3755
}
3856

3957
guiShowHeader() {
40-
return this.getBool("gui", "showHeader", 1)
58+
return this.getBool("gui", "showHeader", 0)
4159
}
4260

4361
guiTextColor() {
@@ -93,7 +111,7 @@ class Settings {
93111
}
94112

95113
showInput() {
96-
return this.getBool("settings", "showinput", 0)
114+
return this.getBool("settings", "showinput", 1)
97115
}
98116

99117
searchMinLength() {

classes/XDListView.ahk

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class XDListView {
55
clv :=
66
digitShortcuts :=
77

8+
89
_New() {
910
}
1011

@@ -16,6 +17,42 @@ class XDListView {
1617
this.digiShortcuts := digiShortcuts
1718
}
1819

20+
updateColors(filteredWindows, contentType) {
21+
isTrayIconsContent := 0
22+
if(contentType = this.s.contentTypeTrayIcons()) {
23+
isTrayIconsContent := 1
24+
}
25+
26+
useVirtualDesktops := this.s.useVirtualDesktops()
27+
amount := filteredWindows.length()
28+
textColor := this.s.guiTextColor()
29+
30+
if(isTrayIconsContent = 1) {
31+
textColor := this.s.guiTextColorTrayIcons()
32+
} else if useVirtualDesktops = 1
33+
{
34+
if(desktop = 0)
35+
{
36+
textColor := this.s.virtualDesktopAllDesktopsTextColor()
37+
}
38+
else if(desktop != currentDesktop)
39+
{
40+
textColor := this.s.virtualDesktopOtherDesktopsTextColor()
41+
}
42+
}
43+
44+
this.clv.clear()
45+
Loop % LV_GetCount()
46+
{
47+
window := filteredWindows.get(A_Index)
48+
if(!window.getIsRunning()) {
49+
this.clv.Row(A_Index, , this.s.guiTextColorHistory())
50+
} else {
51+
this.clv.Row(A_Index, , textColor)
52+
}
53+
}
54+
}
55+
1956
updateRows(filteredWindows, allWindows, windowHistory, contentType) {
2057

2158
LV_Delete()
@@ -24,13 +61,14 @@ class XDListView {
2461

2562
;filteredWindows.sort()
2663

27-
if S.useVirtualDesktops() = 1
64+
if this.s.useVirtualDesktops() = 1
2865
{
2966
filteredWindows.filterByDesktop(currentDesktop)
3067
}
3168

3269
amount := filteredWindows.length()
3370
counter := 1
71+
3472
;M sgBox, > %amount%
3573
Loop %amount%
3674
{
@@ -67,30 +105,9 @@ class XDListView {
67105

68106
LV_Add("", title, process_name, desktopText, pinned)
69107

70-
if(contentType = contentTypeTrayIcons) {
71-
this.clv.Row(A_Index, , S.guiTextColorTrayIcons())
72-
} else if S.useVirtualDesktops() = 1
73-
{
74-
if(desktop = currentDesktop)
75-
{
76-
this.clv.Row(A_Index, , S.guiTextColor())
77-
}
78-
else if(desktop = 0)
79-
{
80-
this.clv.Row(A_Index, , S.virtualDesktopAllDesktopsTextColor())
81-
}
82-
else
83-
{
84-
this.clv.Row(A_Index, , S.virtualDesktopOtherDesktopsTextColor())
85-
}
86-
} else {
87-
if(!window.getIsRunning()) {
88-
this.clv.Row(A_Index, , S.guiTextColorHistory())
89-
} else {
90-
this.clv.Row(A_Index, , S.guiTextColor())
91-
}
92-
}
93108
counter++
94109
}
110+
111+
this.updateColors(filteredWindows, contentType)
95112
}
96113
}

config.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
;@Ahk2Exe-SetMainIcon icon.ico
2-
;@Ahk2Exe-ExeName %A_ScriptDir%\bin\iswitch.exe
2+
;@Ahk2Exe-ExeName %A_ScriptDir%\bin\fast_keyboard_window_switcher.exe
33

44
#NoEnv
55
SendMode Input

iSwitch.ahk renamed to fast_keyboard_window_switcher.ahk

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ closeifinactivated =
6868

6969
selectedIndex := 1
7070

71-
; 0 = all windows
72-
; 1 = tray icons
73-
; 2 = command list
74-
contentTypeAllWindows := 0
75-
contentTypeTrayIcons := 1
76-
contentTypeCommands := 2
7771
contentType := contentTypeAllWindows
7872
lastContentType := contentTypeAllWindows
7973

@@ -154,8 +148,6 @@ if nomatchsound <>
154148
; from the window list
155149
;
156150
;----------------------------------------------------------------------
157-
xdListView := new XDListView()
158-
xdListView.setup(VD, S, CLV, digiShortcuts)
159151

160152
allwinDesktopIndex := Array()
161153
allwinProcessName := Array()
@@ -208,8 +200,6 @@ windowIsOpen := 0
208200

209201

210202
#Include %A_ScriptDir%\includes\inc_gui.ahk
211-
212-
213203
return
214204

215205
#If S.hotkeyReload()
@@ -260,7 +250,7 @@ HotkeyAction:
260250
search =
261251
numallwin = 0
262252
if(S.alwaysStartWithTasks()) {
263-
if(contentType = contentTypeTrayIcons) {
253+
if(contentType = S.contentTypeTrayIcons()) {
264254
forceWindowListRefresh = 1
265255
contentType := contentTypeAllWindows
266256
}
@@ -383,15 +373,15 @@ HotkeyAction:
383373
first_letter := SubStr(search, 1, 1)
384374
if first_letter = :
385375
{
386-
if(lastContentType != contentTypeCommands) {
376+
if(lastContentType != S.contentTypeCommands()) {
387377
forceWindowListRefresh := 1
388378
}
389379
lastContentType := contentType
390380
contentType := contentTypeCommands
391381
GoSub, RefreshWindowList
392382
} else if length > 1
393383
{
394-
if(contentType = contentTypeCommands) {
384+
if(contentType = S.contentTypeCommands()) {
395385
contentType := lastContentType
396386
}
397387
GoSub, RefreshWindowList
@@ -410,7 +400,7 @@ RefreshWindowList:
410400
{
411401
;allWindows.clear()
412402
forceWindowListRefresh := 0
413-
if(contentType = contentTypeTrayIcons) {
403+
if(contentType = S.contentTypeTrayIcons()) {
414404
trayIcons := trayControl.list()
415405
numallwin := trayControl.Length()
416406

@@ -421,10 +411,12 @@ RefreshWindowList:
421411
; replace pipe (|) characters in the window title,
422412
; because Gui Add uses it for separating listbox items
423413
StringReplace, title, title, |, -, all
414+
if title =
415+
continue
424416
allTrayWindows.addNew(this_id, title, 0,0)
425417

426418
}
427-
} else if(contentType = contentTypeCommands) {
419+
} else if(contentType = S.contentTypeCommands()) {
428420

429421
} else {
430422
WinGet, id, list, , , Program Manager
@@ -509,10 +501,10 @@ RefreshWindowList:
509501
}
510502

511503
allWindowsAndHistory := new WindowManager()
512-
if(contentType = contentTypeTrayIcons) {
504+
if(contentType = S.contentTypeTrayIcons()) {
513505
allWindowsAndHistory.addArray(allTrayWindows.getArray())
514506
allWindowsAndHistory.sort()
515-
} else if(contentType = contentTypeCommands) {
507+
} else if(contentType = S.contentTypeCommands()) {
516508
allWindowsAndHistory.addArray(commandList.getArray())
517509
;allWindowsAndHistory.sort()
518510
} else {
@@ -538,7 +530,7 @@ RefreshWindowList:
538530
;M sgBox, title %title%
539531
if(length > 1) {
540532
searchString := search
541-
if(contentType = contentTypeCommands) {
533+
if(contentType = S.contentTypeCommands()) {
542534
;remove the : at the start
543535
searchString := SubStr(search, 1, length)
544536
}
@@ -562,13 +554,11 @@ RefreshWindowList:
562554
}
563555
else
564556
{
565-
ToolTip, do it
566557
match := matchesSearchString(title, searchString)
567558
match2 :=
568559
if S.searchInProcessName()
569560
{
570561
procname := window.getProcessName()
571-
ToolTip, %procname%
572562
match2 := matchesSearchString(procname, searchString)
573563

574564
}
@@ -620,7 +610,7 @@ RefreshWindowList:
620610
if amount = 1
621611
if autoActivateIfOnlyOne
622612
{
623-
if(contentType != contentTypeTrayIcons)
613+
if(contentType != S.contentTypeTrayIcons())
624614
{
625615
; only autoactivate if the search string is not empty
626616
; otherwise the gui would close if only one windows is available
@@ -821,7 +811,7 @@ return
821811

822812
#If guiActive = 1 and S.useDelToEndTask()
823813
DEL::
824-
if(contentType != contentTypeAllWindows) {
814+
if(contentType != S.contentTypeAllWindows()) {
825815
;trayControl.remove(winid)
826816
return
827817
} else {
@@ -857,10 +847,10 @@ return
857847

858848
#If guiActive = 1
859849
F1::
860-
if(contentType = contentTypeTrayIcons) {
861-
contentType := contentTypeAllWindows
850+
if(contentType = S.contentTypeTrayIcons()) {
851+
contentType := S.contentTypeAllWindows()
862852
} else {
863-
contentType := contentTypeTrayIcons
853+
contentType := S.contentTypeTrayIcons()
864854
}
865855
lastContentType := contentType
866856
forceWindowListRefresh = 1
@@ -872,7 +862,7 @@ return
872862
if(selectedIndex < 1) {
873863
return
874864
}
875-
if(contentType != contentTypeAllWindows) {
865+
if(contentType != S.contentTypeAllWindows()) {
876866
return
877867
}
878868
window := filteredWindows.get(selectedIndex)
@@ -888,7 +878,7 @@ return
888878
;
889879
ActivateWindow:
890880
window := filteredWindows.get(selectedIndex)
891-
if(contentType = contentTypeTrayIcons) {
881+
if(contentType = S.contentTypeTrayIcons()) {
892882
window_id := window.getHwnd()
893883
if(S.moveMouse()) {
894884
winTools := new WinTools()

github_modules/VD.ahk

includes/inc_gui.ahk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ SetupGui:
3535
}
3636

3737
CLV := New LV_Colors(HLV)
38-
38+
xdListView := new XDListView()
39+
xdListView.setup(VD, S, CLV, digiShortcuts)
3940
return
4041

4142
MyListView:

node_modules/.package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)