Autohotkey 自动化脚本中的 全屏坐标获取
(2014-11-17 15:00:26)
标签:
autohotkey获取全局坐标坐标变换 |
分类: 程序与脚本 |
Autohotkey 自动化脚本中的 全屏坐标获取
默认
MouseGetPos 和PixelGetColor这些函数获取的坐标都是 相对活动窗口的相对坐标
当活动窗口发生变化的时候 这些坐标也会跟着变化
如果需要获取针对整个屏幕的绝对坐标则需要调用CoordMode进行设置
配置可以分别对应不同的函数
例如Mouse和Pixel 需要分别设置,另外需要注意子程序中如果使用了坐标 也要先调用这个函数再用
CoordMode, ToolTip|Pixel|Mouse|Caret|Menu [, Screen|Relative]
Parameters
Param1 |
ToolTip: Affects ToolTip. Pixel: Affects PixelGetColor, PixelSearch, and ImageSearch. Mouse: Affects MouseGetPos, Click, and MouseMove/Click/Drag. Caret: Affects the built-in variables A_CaretX and A_CaretY. Menu: Affects the "Menu Show" command when coordinates are specified for it. |
Param2 |
If Param2 is omitted, it defaults to Screen. Screen: Coordinates are relative to the desktop (entire screen). Relative: Coordinates are relative to the active window. |
CoordMode,Pixel,Screen
CoordMode,Mouse,Screen
PixelGetColor,MycolorMonitor,MouseX,MouseY,RGB
===转=============
move mouse position from whole screen vs active window
http://www.autohotkey.com/board/topic/63184-move-mouse-position-from-whole-screen-vs-active-window/