SetMousePos to bottom right corner - Forum

Forum Navigation
You need to log in to create posts and topics.

SetMousePos to bottom right corner

I see that

SetMousePos "0" "0"

places the mouse pointer in the center of the screen and that appears to be independent of scaling and resolution.

Is there a similar way to move the mouse pointer to the bottom right corner of the screen, also independent of scaling and screen resolution (I realize that I may need to make my publication full-screen)?

And then move the mouse pointer to the left. Let's say halfway of the taskbar?

My aim is to hover the mouse pointer over the notification area.

@talker

To expand the program to the full screen, it is sufficient to assign a value to a variable:
SetVar "[WindowState]" "Maximized"

You can move the mouse to the bottom right corner of the screen with the dec_Plus 1.9 (David Esperalta) plugin:
dec_EstablecerPosicionRaton "[ScreenWidth]" "[ScreenHeight]"

To consider the taskbar - which side it is on, what size it is, etc., use the plugin TaskbarControl 2.0 (D. Cantero)

Knowing coordinates of taskbar you can move mouse where you need.

Thanks Vadim, appreciated.

Do you have some links  for these plug-ins?

Are they commercial or free?

@talker

These plugins are free. But David Esperalta has new plugins, check his site too:

https://www.decsoftutils.com/neoplugins

Uploaded files:
  • You need to login to have access to uploads.

Thanks Vadim.

Although I used it in the sample project I attached, TaskbarControl.nbp does not appear to be needed (and from what I can tell setting the NEO app to fullscreen neither). It appears that the dec_Plus plug-in does exactly what I need. Although it appears to place the mouse pointer at the very bottom of the Taskbar (not in the middle, when it comes to height). So you need  to look very closely to see the pointer moving at the very bottom of notification area and taskbar.

On my regular HD screen SetMousePos "0" "600" appears to make the pointer hover over the notification area/taskbar in a somewhat straight-line which is what I need. If I use SetMousePos "0" "500" it's moving up somewhat (in a 170° angle).

My 600 Y position is arbitrary. Maybe it just works because the pointer can get any lower (would drop out of view)?

I wonder though, how it will behave on a UHD screen (3840x2160). If someone would care to test this for me that would be appreciated. The behavior also differs per Windows scaling setting... I attached both the NEO file and the executable.

About dec_Plus.nbp. Is there a .loc file for this? I don't speak Spanish...

Thanks again!

Uploaded files:
  • You need to login to have access to uploads.

@talker

Good day! If you want your program to work correctly on any screen, you need to programmatically determine the size and position of the taskbar (left, top, right, bottom). Knowing the coordinates of the taskbar you can always calculate where to move the mouse. If you know in advance where to move the cursor, then one command is enough, in this case TaskbarControl is not needed.

The position of the mouse, as well as other objects on the screen - is calculated for the upper left corner of the object. Since the standard mouse cursor is the tip of the arrow, the rest of the cursor is behind the frame and is not visible.

I added a pixel correction to your code so that the cursor is visible (with me, this code causes the cursor to appear exactly above the date/time in the notification area in the lower right corner). And I added a mouse click after half a second to open the calendar from the notification area and then a click again to hide the calendar (see video and demo file).

With the help of Google translator I made a file with English translation of the commands.

Update: replaced the mousepos.pub file with the correct one.

Uploaded files:
  • You need to login to have access to uploads.
proforma.guyot, Darbdenral and Talker have reacted to this post.
proforma.guyotDarbdenralTalker

Thanks Vadim, this is very helpful. On my system the pointer also appears exactly above the date/time in the notification area.

A big thanks for your translation of dec_Plus to English. This sure looks like a powerful plug-in!

Vadim and proforma.guyot have reacted to this post.
Vadimproforma.guyot