pls help with mouse clicks in dual monitor situation

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Nurali
Posts: 1
Joined: 13 Apr 2023, 14:38

pls help with mouse clicks in dual monitor situation

Post by Nurali » 13 Apr 2023, 14:55

hello,
im a complete noob and coding is not something that is easy for me.
I need to do some custom shortcuts in a form of recored mouse clicks to speed up my work.
I managed to write up few codes and most work (big grin on my face), although they all only work correctly if I have mouse positioned on left (main) screen at the time I execute the command. Else its doing a click on right screen.
I cant figure out how to optimise my code to make it work in dual monitor layout..

Most of shortcuts I do are just a single or multiple mouse clicks.
Few are with mouse click, enter fixed number and confirm input by enter.
If anyone helps me with editing one of each I think I can do the rest by my own as it would only be about changing XY coordinates.

Thanks in advance, appreciate any help ! <3

here's example nr1:

Code: Select all

!p::
SetDefaultMouseSpeed, 0
MouseGetPos x, y
SendEvent {Click, 148, 943}.
SendEvent {Click, 739, 986}.
MouseMove %x%, %y%
--

and example nr 2 with mouse click and keyboard input + enter to confirm my input.
this one works at times but mostly inputs incorrect number and does a strange mouse click, not as intended.. :D
oh I dont know how to implement "enter" to the command to confirm my input (.500)

Code: Select all

^!+å::
SetDefaultMouseSpeed, 0
MouseGetPos x, y
SendEvent {Click, 1615, 947}.
SendEvent {Click, 1485, 1190}.
Send ".500"

MouseMove %x%, %y%
[Mod edit: [code][/code] tags added.]

thank you!

[Mod edit:Moved to AHK v1 help, based on posted code, ]

Return to “Ask for Help (v1)”