版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/mr_zhuqiang/article/details/91490298
依赖的脚本:AutoHotkey 直接安装上即可
把一下脚本内容存为 ahk 文件,然后执行即可;单屏的可以自己调整下面判定的 xpos、ypos 数值调整到你想要的范围
双屏版左右切换-Win10边缘触碰切换虚拟桌面脚本.ahk
;左右两个屏幕:1920x1020;左侧边缘为负数,右侧边缘为正数
;双屏显示器版本:左右双侧中间区域边缘部分可触发
;这个是设置鼠标坐标的相对位置,本例是相对雨整个桌面
CoordMode, Mouse ,Screen
#Persistent
;这个设置了获取鼠标信息的频率,数值越小边缘热区越灵敏
SetTimer, WatchCursor, 300
return
WatchCursor:
GetKeyState, state, LButton
MouseGetPos, xpos, ypos, id, control
;若要重设边缘热区的范围请,把下一行的 ; 号去掉,就会在鼠标位置显示鼠标的坐标,根据坐标修改以下数值
;ToolTip,x:%xpos% y:%ypos% state:%state%
if(state = "U" ){
if(ypos > 250 and ypos < 850){
if(xpos > 1918){
Send ^#{Right}
MouseMove, xpos -20, ypos
}else if(xpos = -1920){
Send ^#{Left}
MouseMove, xpos + 20, ypos
}
;显示所有虚拟桌面的热区
}else if(xpos = 0 and ypos = 0){
Send #{Tab}
MouseMove, 10, 10
}
}
return
;原文:https://blog.csdn.net/a__yes/article/details/77093183
主屏版-左侧上下边缘-Win10边缘触碰切换虚拟桌面脚本.ahk
;双屏显示器版本:只在主屏幕左侧 50 ~ 200 上下边缘有效果,这样是为了误操作
;这个是设置鼠标坐标的相对位置,本例是相对雨整个桌面
CoordMode, Mouse ,Screen
#Persistent
;这个设置了获取鼠标信息的频率,数值越小边缘热区越灵敏
SetTimer, WatchCursor, 300
return
WatchCursor:
GetKeyState, state, LButton
MouseGetPos, xpos, ypos, id, control
;若要重设边缘热区的范围请,把下一行的 ; 号去掉,就会在鼠标位置显示鼠标的坐标,根据坐标修改以下数值
;ToolTip,x:%xpos% y:%ypos% state:%state%
if(state = "U" ){
;x方向的范围
if(xpos > 50 and xpos < 200){
;y方向的范围
if(ypos = 1079){
Send ^#{Right}
MouseMove, xpos, 1059
}else if(ypos = 0){
Send ^#{Left}
MouseMove, xpos, 20
}
;显示所有虚拟桌面的热区
}else if(xpos = 0 and ypos = 0){
Send #{Tab}
MouseMove, 10, 10
}
}
return
;原文:https://blog.csdn.net/a__yes/article/details/77093183