Skip to content

Commit

Permalink
feat(win): vscode 支持前进后退 恢复标签页
Browse files Browse the repository at this point in the history
  • Loading branch information
shaddollxz committed Jan 1, 2024
1 parent 304da61 commit ef13b09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 10 additions & 3 deletions win/modules/mode-caps.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,26 @@ mode_caps := useMode("CapsLock", keyMap.onlyCaps)
*t:: {
Send(keyMap.ctrl . "t")
}

; 恢复上一个关闭的标签页
*b:: {
Send(keyMap.ctrl . keyMap.shift . "t")
}
; 刷新标签页
*v:: {
if (isBrowser()) {
Send("{F5}")
}
}

; 前进
*z:: {
if (isBrowser()) {
if (isBrowser() || isVscode()) {
Send(keyMap.alt . keyMap.onlyRight)
}
}
; 后退
*x:: {
if (isBrowser()) {
if (isBrowser() || isVscode()) {
Send(keyMap.alt . keyMap.onlyLeft)
}
}
Expand Down
5 changes: 5 additions & 0 deletions win/utils/assert.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ isBrowser() {
browserList := ["Mozilla Firefox", "Google Chrome", "Microsoft​ Edge", "Opera"]

for (browser in browserList) {
OutputDebug(WinActive(browser))
if (WinActive(browser)) {
return true
}
}
}

isVscode() {
return WinActive("Visual Studio Code")
}

0 comments on commit ef13b09

Please sign in to comment.