Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-02-27 10:49:53

benyig
Member
Registered: 2017-02-27
Posts: 2

How to prevent mouse cursor from entering the second display?

Hello,

I'm preparing for a presentation where I will send a video from my laptop to a projector via VGA cable (that's the only common port between the two devices). It's crucial that nothing but the video appears on the external display during the presentation. Is there a way to prevent the mouse cursor from entering the second display by accident?

Thanks!

Offline

#2 2017-02-27 12:03:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,493

Re: How to prevent mouse cursor from entering the second display?

Hello and welcome.

There used to be a program called "mouse jail" that did this. There is this gentoo wiki article that talks about it and this page has a still-working link to the source. You might want to give that a try to see if it still works.

Otherwise, you could write a script using xdotool to pre-define a containment area for the mouse and constantly monitor the mouse position and if it moves out of the containment area, automatically move it back to a location inside the containment area. Something like:

#!/bin/bash

# the location to move the mouse to when its outside of the containment area
MOVETO_X_LOC=100
MOVETO_Y_LOC=100

# the dimensions of the containment area that you want the mouse cursor to stay inside of
#     (must be within the containment area)
TOP_X=100
TOP_Y=100
BOT_X=300
BOT_Y=300

# the check and move routine
while true
do
  CURR_MOUSE_X=$(xdotool getmouselocation | awk '{print $1}' | awk -F':' '{print $2}')
  CURR_MOUSE_Y=$(xdotool getmouselocation | awk '{print $2}' | awk -F':' '{print $2}')
  
  if [ $CURR_MOUSE_X -lt $TOP_X ] || [ $CURR_MOUSE_X -gt $BOT_X ] || [ $CURR_MOUSE_Y -lt $TOP_Y ] || [ $CURR_MOUSE_Y -gt $BOT_Y ]
  then
     xdotool mousemove $MOVETO_X_LOC $MOVETO_Y_LOC
  fi
  
  sleep 0.5
done

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2017-02-27 16:21:05

benyig
Member
Registered: 2017-02-27
Posts: 2

Re: How to prevent mouse cursor from entering the second display?

Thank you, I'll give it a try.

Offline

#4 2017-02-28 20:47:40

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: How to prevent mouse cursor from entering the second display?

VLC hides the mouse cursor (when you are not moving it) and has a full-screen mode. I used to use it to view videos on a (CRT) television via S-video cable and do not recall being troubled by any mouse-like distractions.

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 529.1 KiB (Peak: 530.38 KiB) ]