Quick Switch Virtual Desktop[AutoHotkey]

55次阅读

共计 781 个字符,预计需要花费 2 分钟才能阅读完成。

Quick Switch Virtual Desktop[AutoHotkey]
/* Library:
* Quick Switch Virtual Desktop
* Description:
* 在屏幕四周,任务栏,桌面上使用鼠标滚轮来切换虚拟桌面。
* Warnning:
* None.
* Version:
* v1.0.3
* Author:
* 泠音
*/

#MaxHotkeysPerInterval 300
WheelUp::
If (isHook()){
Send, {LWinDown}{CtrlDown}{Left Down}{LWinUp}{CtrlUp}{Left Up}
}else{
MouseClick, WheelUp
}
return

WheelDown::
If (isHook()){
Send, {LWinDown}{CtrlDown}{Right Down}{LWinUp}{CtrlUp}{Right Up}
}else{
MouseClick, WheelDown
}
return

isHook(){
CoordMode, Mouse,Screen
MouseGetPos, X,Y,ID,CLASS
; t1 := A_ScreenWidth-X
; t2 := A_ScreenHeight-Y
; MsgBox X:%X% Y:%Y% dw:%t1% dh:%t2% W:%A_ScreenWidth% H:%A_ScreenHeight%
return MouseIsOver(“ahk_class WorkerW”)
or MouseIsOver(“ahk_class Shell_TrayWnd”)
or X == 0
or Y == 0
or A_ScreenWidth-X<2
or A_ScreenHeight-Y<2
}

MouseIsOver(WinTitle) {
MouseGetPos,,, Win
return WinExist(WinTitle . ” ahk_id ” . Win)
}

正文完
 0