Screen resolution (for mouse movement using RobotGo)

Hello Everyone
I am trying to get the (main) display resolution. I am using this code at present for a VNC like application - where mouse.X and mouse.Y are 0…1 ranges for left…right and bottom…top

width, height := robotgo.GetScreenSize()
x := int(*mouse.X * float32(width))
y := int(*mouse.Y * float32(height))
robotgo.Move(x, y)

This works fine when the system (PC Win10) has only one display - but when there are multiple, the resolution is set to the overall width and height of all the displays - i.e. for the Desktop.

Please does anyone know if robotgo can get the resolution for an individual (possibly the main) display?

Or if not - is there a way to get the resolution of the main display simply and cross platform.

BTW - I am aware of SDL - but that seems to require a different compiler (32bit vs 64bit) from robotgo - though I haven’t verified this myself.

Thank you - Andy

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.