spyoungtech / ahk

Python wrapper for AutoHotkey with full type support. Harness the automation power of AutoHotkey with the beauty of Python.
MIT License
887 stars 66 forks source link

Glyph.ahk.mouse_position value is wrong compared to win32api #344

Closed Apprisco closed 1 month ago

Apprisco commented 2 months ago

describe your issue

print(ahk.mouse_position,wa.GetCursorPos()) gives different values on a multi monitor system. This is especially bad as the Window subclass works perfectly, giving the correct position via get_position.

ahk.version

No response

AutoHotkey version

No response

Code to reproduce the issue

print(ahk.mouse_position,wa.GetCursorPos())

Traceback/Error message

No response

spyoungtech commented 2 months ago

Did you set the appropriate CoordMode type? Note that coordinates are relative to the active Window, unless coord mode is changed.

https://www.autohotkey.com/docs/v2/lib/MouseGetPos.htm

https://www.autohotkey.com/docs/v2/lib/CoordMode.htm

spyoungtech commented 1 month ago

Closing as stale and can't reproduce. If this is still a problem, please open another issue with the details and minimal reproducible example.