Sorry if it sounds confusing, but this is not a biology inquiry. I'm planning to switch to Linux, but I have a few questions need answered. If a single monitor is mirrored like described in this link, then will we see the pointer onscreen move similarly to, or contrarily to our physical mouse-hand movement? In case it is reversed, is there any way to make the mouse move like in normal setups while keeping the screen mirrored?
-
"make the mouse move like in normal setups" is a bit ambiguous to me. Say there's an icon on the screen, and in normal mode the icon is to the left of the pointer. Now, with the screen mirrored, it's to the right. When you move your mouse to the left, do you want to (a) move the pointer towards the icon - so left on the regular screen, or (b) away from the icon - so left on the actual displayed content? – muru Apr 14 '23 at 06:38
-
1Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 14 '23 at 09:27
-
@muru if we move the physical mouse left to right, then I want the pointer also move left to right relative to our eyes. In other words, just like what you've been experiencing for years. – longtry Apr 15 '23 at 10:30
1 Answers
The actual command described in the OP's link is xrandr --reflect [x|y|xy]. Its intended uses are for e.g. when you are displaying on a projector that's mounted upside down to the ceiling, and/or projecting to a through-projection screen so the image needs to be flipped to be right-way-round for the viewers.
In both cases, it would be expected that both the display and the mouse movements would be flipped the same way: the xrandr --reflect is meant to affect the totality of the GPU's output for a particular display device, to compensate for either a non-standard positioning of the display device itself, or an optical device that mirrors the output of the display device.
To "un-reverse" the mouse motions while keeping the screen mirrored, you would have to use the coordinate transformation matrix commands as suggested by A.B in their earlier deleted answer.
Example:
xinput indicates my wireless mouse is identified as as Logitech USB Receiver, and xrandr indicates my display output is DP-0.
xinput --set-prop --type=float "Logitech USB Receiver" 'Coordinate Transformation Matrix' -1 0 1 0 1 0 0 0 1
Now my display is normal, but when I move the mouse left, the pointer moves right, and vice versa. In other words, the mouse motion is mirrored in the X axis.
xrandr --output DP-0 --reflect x
After adding this command, my entire display is mirrored in the X direction: the mouse arrow pointer points to top-right instead of top-left. But because of the earlier command to invert the mouse motion in the X direction, the mouse "feels" normal.
xinput --set-prop --type=float "Logitech USB Receiver" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
This returns the mouse motion transformation matrix to standard, so while the xrandr --reflect x is still in effect, now both the mouse directions and the desktop view are flipped in X direction. To move the mouse to display coordinates (0,0), I would move the mouse up and left as usual, while the mouse pointer moves to the top right corner of the screen.
xrandr --output DP-0 --reflect normal
This undoes the output reflection, returning everything back to normal.
- 87,318
- 3
- 112
- 232
-
Great, thanks! I, too, feel that A.B's answer is enlightening, but when I visited the question again, it was deleted. Don't know why, though. – longtry May 05 '23 at 03:45
-
I've just installed Mint and the whole reverse-mirror thing works flawlessly! You're the man! I wonder if other distros also use X or wayland, and how to know that from the terminal. – longtry Jun 04 '23 at 11:53
-
Could you translate the commands in your answer to those in Wayland? I installed Fedora 38 GNOME and got stuck – longtry Jun 14 '23 at 00:10
-
1Sorry, I haven't had a chance to really use Wayland yet. I understand it has its own way to process input events, so the x* commands are not applicable to it. `echo $XDG_SESSION_TYPE` should output either `x11` or `wayland` according to the type of the session. – telcoM Jun 14 '23 at 13:54