gpt4 book ai didi

windows - 通过 AutoHotKey 确定光标在哪个监视器中。监控底值错误

转载 作者:可可西里 更新时间:2023-11-01 09:57:22 35 4
gpt4 key购买 nike

我希望能够确定光标所在的监视器。理想情况下,这将是一个适用于任何数量/配置的监视器的动态解决方案。

我认为只读取每个监视器的边界并测试光标是否在所述边界内会很简单。

CoordMode, Mouse, Screen
GetMonitorMouse()
{
MouseGetPos, x, y

SysGet, Mon1, Monitor, 1
SysGet, Mon2, Monitor, 2
SysGet, Mon3, Monitor, 3

if(x >= Mon1Left && x <= Mon1Right && y >= Mon1Bottom && y <= Mon1Top)
{
TrayTip,,monitor1, 1, 16
SetTimer, TurnOffTrayTip, 500
}
else if(x >= Mon2Left && x <= Mon2Right && y >= Mon2Bottom && y <= Mon2Top)
{
TrayTip,,monitor2, 1, 16
SetTimer, TurnOffTrayTip, 500
}
else if(x >= Mon3Left && x <= Mon3Right && y >= Mon3Bottom && y <= Mon3Top)
{
TrayTip,,monitor3, 1, 16
SetTimer, TurnOffTrayTip, 500
}
else
{
TrayTip,,monitor unknown %x%-%y%, 1, 16
SetTimer, TurnOffTrayTip, 500
SplashTextOn, 400, 300, CursorMonitor, monitor unknown %x%-%y% # %Mon1top% ~ %Mon1Bottom% $ %Mon1Left% ~ %Mon1Right%
}

sleep, 3000
GetMonitorMouse()

}

GetMonitorMouse()

TurnOffTrayTip:
TrayTip
return

但是,我不明白 SysGet 返回的边界。底部边界显得随意。例如,Mon1Bottom-8,Mon2Bottom 为352

下图显示了我的三台显示器在 Windows 中的布局。在绿色中,我显示了 SysGet 返回的边界(顶部、底部、左侧、右侧)。在红色部分,我显示了显示器的实际尺寸。

Monitor Layout

我不知道如何测试我的光标在哪个监视器中。有人知道我如何修复我的脚本吗?我正在使用 Windows 10。

最佳答案

看来您的脚本没问题。根据以上评论,这里对您的设置进行了更准确的描述。

Monitor Setup

所以,我认为这可以归结为“为什么显示器 2 的底边是 Y-8?”我想它可能是不小心放在这里的。要修复它,我会尝试以下操作:

  1. 将监视器 3 移到太空;
  2. 将显示器 2 向上移开,然后将其重新定位在显示器 1 的正上方(可能最初是这样设计的);
  3. 最后,重新定位显示器 3,使其顶部边缘与显示器 2 的顶部边缘对齐。

现在,就 SysGet 中的监视器名称而言,它们可能与 Windows 显示设置中的识别方式匹配,也可能不匹配。我认为您只需要先确定哪个显示器是哪个并进行测试即可。

关于windows - 通过 AutoHotKey 确定光标在哪个监视器中。监控底值错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55501266/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com