适用于双屏,能模拟实现单鼠标双指针(伪),通过 F10
或者自定义的按键来切换两个指针的位置
适用于双屏是因为再多的屏就模拟不出来效果了( doge
少废话,先看东西
CoordMode, ToolTip, screen
CoordMode, Mouse, screen
CoordMode, Pixel, screen
SplashImageGUI(img, X, Y)
{
Gui, CURSOR:Margin , 0, 0
Gui, CURSOR:Add, Picture,, %img%
Gui, CURSOR:+LastFound -Caption +AlwaysOnTop +ToolWindow -Border
Winset, TransColor, White
Gui, CURSOR:Show, xCenter yCenter
return
}
;==============================================================================
; simulated 2nd cursor, press F10 swap the positions of the two cursors
;==============================================================================
image = mouse.png
SplashImageGUI(image, "Center", "Center")
return
; in case of emergency, hit escape ;)
esc::exitapp
return
;=======================================================
; swap the positions of the cursors
;=======================================================
f10::
blockinput, on ; block keyboard & moouse during the swap
MouseGetPos, xpos, ypos
winmove, switchCursor.ahk,, %xpos%, %ypos%
MouseMove, xloc, yloc ,0
xloc := xpos
yloc := ypos
blockinput, off
return
脚本命名请对应 winmove
中的窗口名,如果你把 AHK 封装成了 exe 文件,请注意修改这里
F10 切换两个指针,ESC 退出。如果你在调试请将 blockinput
设为 off ;如果你不幸地,被 blockinput
后才看到这段话,请 Ctrl+Alt+Del
,奇异博士教过我们看书要先看注意事项。
image
随便找一个鼠标图片,把背景抠成透明,然后用 Windows 的画图 resize 一下大小,再点保存就会变成白底(很重要),再跟脚本丢到同一个目录就行了。因为透明效果靠 Winset, TransColor, White
实现,如果是透明图片,载入时会变成黑底。
1
locoz 2019-11-20 12:22:13 +08:00 via Android
你好骚啊
|
2
karnaugh 2019-11-20 12:33:40 +08:00
奇♂怪♂需♂求
|
3
jin7 2019-11-20 12:38:01 +08:00
推荐一个找图工具
http://ahkcn.net/thread-5029.html |
4
vtoexshan 2019-11-20 13:14:21 +08:00
感谢老哥出手!
|
5
cweijan 2019-11-21 21:19:54 +08:00
不错
|
6
cweijan 2019-11-21 22:58:46 +08:00 2
做了一些改进, 确保能够切换屏幕
``` ; #NoTrayIcon #SingleInstance force CoordMode, Mouse, screen f10:: SysGet, MonitorCount, MonitorCount SysGet, Mon, Monitor, %MonitorCount% MouseGetPos, xpos, ypos if(xpos>MonLeft){ ;; in second monitor x2 := xpos y2 := ypos if(x1="" ){ x1 := MonLeft/2 y1 := MonBottom/2-100 } MouseMove, x1, y1 ,0 }else{ ;; in first monitor x1 := xpos y1 := ypos if(x2=""){ x2 := MonLeft+((MonRight-MonLeft)/2) y2 := MonBottom/2-100 } MouseMove, x2, y2 ,0 } return ``` |