hi, i am using a dual monitor setup,
just wondering is it possible to make a script movies download movies at forum that i click a hot key, for example "ctrl+shift+alt+m", then the mouse cursor will move to the center position of active window in the second monitor that i use and vice versa
[dual monitor] move mouse cursor to the center of active window
-
- Posts: 1
- Joined: 29 Dec 2018, 04:54
[dual monitor] move mouse cursor to the center of active window
Last edited by Henrryparth on 30 Dec 2018, 00:28, edited 1 time in total.
Re: [dual monitor] move mouse cursor to the center of active window
Here you go @Henrryparth
Code: Select all
CenterMouseOnActiveWindow:
Sleep 50
CoordMode,Mouse,Screen
WinGetPos, winTopL_x, winTopL_y, width, height, A
winCenter_x := winTopL_x + width/2
winCenter_y := winTopL_y + height/2
;MouseMove, X, Y, 0 ; does not work with multi-monitor
DllCall("SetCursorPos", int, winCenter_x, int, winCenter_y)
;Tooltip winTopL_x:%winTopL_x% winTopL_y:%winTopL_y% winCenter_x:%winCenter_x% winCenter_y:%winCenter_y%
return
Re: [dual monitor] move mouse cursor to the center of active window
@M_L
MouseMove is working with second monitor. Big disadvantage of this is that You must have second monitor always in the same place.
@Henrryparth
This code should work
Edit: This code is almost working
If there is somebody who can check what is wrong with my code I will very appreciate
MouseMove is working with second monitor. Big disadvantage of this is that You must have second monitor always in the same place.
This code should work
Code: Select all
CoordMode,Mouse,Screen
^+!m::
screenposH:=1 ;put 1 for 2nd screen above 1st, and -1 for 2nd screen below 1st or if verticaly set to 0
screenposV:=0 ;put 1 for 2nd screen on the left, and -1 for 2nd screen on the right or if horizontaly set to 0
;put here your second screen resolution
screenresX:=0 ;if screens set horizontally set to 0 ScreenResX
screenresY:=1080 ;if screens stacked verticaly set to 0 ScreenResY
MouseMove, (A_screenwidth/2)-(screenresX*screenposV), (A_screenheight/2)-(screenresY*screenposH)
return
If there is somebody who can check what is wrong with my code I will very appreciate
Hi,
I was trying make this on my own but I'mgood only in basics not good even in basics.
Sorry for my bad English. If something is unclear I will try better next time.
I was trying make this on my own but I'm
Sorry for my bad English. If something is unclear I will try better next time.