Skip to content

Commit

Permalink
fix(window-manager): play-pause on alt-tab view
Browse files Browse the repository at this point in the history
play-pause on alt-tab view
  • Loading branch information
snomiao committed Jan 12, 2025
1 parent 12e8b1f commit 856ddf6
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions Modules/CLX-WindowManager.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ CLX_MoveCurrentWindowTo(x)
SendEvent !{Tab}
}


!1:: CLX_MoveCurrentWindowTo(1) ; 选中窗口移动到1号桌面
!2:: CLX_MoveCurrentWindowTo(2) ; 选中窗口移动到2号桌面
!3:: CLX_MoveCurrentWindowTo(3) ; 选中窗口移动到3号桌面
Expand All @@ -706,10 +707,20 @@ CLX_MoveCurrentWindowTo(x)
!s:: Down ;
!r:: Volume_Up ; 音量+
!f:: Volume_Down ; 音量-
!t:: Media_Stop
!g:: Media_Play_Pause

; cx 关闭应用
!c:: SendEvent {Blind}{Delete}{Right} ; 关闭应用
!x:: SendEvent {Blind}{Delete}{Right} ; 关闭应用
!c:: AltTabViewCloseWindow()
!x:: AltTabViewCloseWindow()

AltTabViewCloseWindow(){
if (WindowManager_Win11_Detect()){
SendEvent {Blind}{Delete}
}else{
SendEvent {Blind}{Delete}{Right} ; 关闭应用
}
}

; 切换多桌面
!q:: Send ^#{Left} ; 向左切换多桌面
Expand Down Expand Up @@ -937,4 +948,17 @@ ShellMessage( wParam, lParam )
return
}
鼠标位置还原尝试()
}

WindowManager_Win11_Detect()
{
IServiceProvider := ComObjCreate("{C2F03A33-21F5-47FA-B4BB-156362A2F239}", "{6D5140C1-7436-11CE-8034-00AA006009FA}")
IVirtualDesktopManagerInternal := ComObjQuery(IServiceProvider, "{C5E0CDCA-7B6E-41B2-9FC4-D93975CC467B}", "{F31574D6-B682-4CDC-BD56-1827860ABEC6}")
ObjRelease(IServiceProvider)
if (IVirtualDesktopManagerInternal) {
; win10
return false
}
; it is Win11 maybe
return true
}

0 comments on commit 856ddf6

Please sign in to comment.