You are not logged in.

#1 2020-04-29 18:47:26

janvr
Member
Registered: 2014-12-23
Posts: 14

Prevent mouse from moving between monitors

Hello,
I recently set up a second monitor, and I set it right of my first using xrandr. However, I don't want my mouse to move between the two screens because I have a keyboard shortcut for that and it's annoying when the cursor accidentally ends up on the other screen; is there any way to make a sort of barrier there to make sure the mouse can't move out of the screen unless the keyboard shortcut is used? I don't know if this can be done with xrandr, or if it can be set in the config file of my window manager (awesomewm).
Thanks, Jan van Rossum

Offline

#2 2020-04-29 18:59:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,519
Website

Re: Prevent mouse from moving between monitors

You can set a different geometry with xrandr so there isnt a shared border for the mouse to travel across.  I've previously had a second screen "north east" of the primary, sharing just a corner.  The mouse could move from one to the other but only at the shared corner.  I suspect you'd get hard boundaries if you set the geometries so their borders weren't even intersecting, though I've never done that myself.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-04-29 19:26:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,822

Re: Prevent mouse from moving between monitors

Iirc this once worked, then was opened, then smartened up (you cannot move into an area where nothing will follow but still head over to another output through the void)

You can try https://github.com/cas--/XCreateMouseVoid

Online

Board footer

Powered by FluxBB