Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual monitors: Can't move the mouse to the other monitor #273

Open
davidlevner opened this issue Jan 24, 2025 · 3 comments
Open

Dual monitors: Can't move the mouse to the other monitor #273

davidlevner opened this issue Jan 24, 2025 · 3 comments

Comments

@davidlevner
Copy link

My system has two monitors. The mousemove command moves the mouse pointer to a spot on the monitor where the mouse pointer is currently. Is there a way to move the mouse to the other monitor?

It would also be helpful to know where the mouse pointer currently is, similar to the xdotool command getmouselocation. If such a command is implemented, I would like it to return the coordinates of the mouse pointer and which screen the mouse pointer is currently on.

@ClassicOldSong
Copy link
Collaborator

ClassicOldSong commented Jan 24, 2025

It's not possible for ydotool to get current mouse position because it' just a virtual mouse. You need other tools that can talk to your current display manager to get the cursor position.

@Mte90
Copy link

Mte90 commented Jan 27, 2025

The problem with multiple monitors is that the position is not getting the right starting x/y.

Also with absolute or not is not positioning in the right monitor and in the right position.
It is like that the position is referenced to the monitor where it is, and with negative or bigger number can move to the other one.

The problem is like there is no way to reset the position to something in the center (I have 3 monitor with different sizes).

if [ "$1" -eq "1" ]; then
    ydotool mousemove --absolute -x 300 -y 200
    ydotool mousemove -x -1200 -y -250
elif [ "$1" -eq "2" ]; then
    ydotool mousemove --absolute -x 300 -y 200
elif [ "$1" -eq "3" ]; then
    ydotool mousemove --absolute -x 300 -y 200
    ydotool mousemove -x 1200 -y -250
fi

I would like to move to the other screen but doens't work very good as everytime the position is different and based from where the mouse is.

@Mte90
Copy link

Mte90 commented Jan 27, 2025

https://github.com/jinliu/kdotool

As example this tool return:

X=4359
Y=484
SCREEN=2

But those values doens't work on ydotool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants