Welcome, Guest

Author Topic: How to rotate display including mouse cursor on  (Read 1953 times)

att2

  • Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
How to rotate display including mouse cursor on
« on: June 15, 2017, 11:51:51 PM »
I have an olimex a20 olinuxino lime2 with emmc;
OS=debian 8.3 jessie;

I want to rotate the screen ;
I changed usr/share/X11/xorg.conf/99-something.conf and added

Quote
option "rotate" "cw"

Now the screen is rotated but the mouse cursor is not rotated.

The mouse position is incorrect. When you e.g. select a rectangle the upper left corner of the
rectangle does not match the mouse position. Neither does the movement of the mouse direction match the actually moved mouse. You select a totally different rectangle than you would guess, and you select it in a totally different direction opposite to your real mouse movements.

So how to get the mouse right once you have rotated the display?


LubOlimex

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1967
  • Karma: +50/-3
Re: How to rotate display including mouse cursor on
« Reply #1 on: August 17, 2017, 01:46:26 PM »
Are you using a real mouse or you are using the touchscreen and meaning the mouse cursor? For the first touchscreen calibration after you have rotated the display - use a mouse instead of the touchscreen. Alternatively, again edit 99-calibration.conf (or create it if it is missing) and enter manually the coordinates, they should come as number in this line:

Option "Calibration" "236 26301 169 16412" - note that these are not actual values that I have tested; just pointing out where the calibration variables are stored - the four numbers are the coordinates of the crosses that you need to press during calibration.
Technical support and documentation manager at Olimex

SR-Digitronic

  • Newbie
  • *
  • Posts: 13
  • Karma: +1/-0
Re: How to rotate display including mouse cursor on
« Reply #2 on: September 06, 2017, 11:32:42 AM »
I can confirm this issue.
I added also added that to my xorg.conf and use a 4 inch LCD display with touch.
Code: [Select]
        Option          "Rotate" "UD"Mouse cursor is turned upside down.
The cursor is displayed where I pressed with my finger, but the click gets registered at a different location.
ts_calibrate is displayed upside down, which is not a surprise since it does not use Xorg.

And when I invert the cursor via xorg, the clicks are still slightly off
Code: [Select]
        Option "InvertX" "on"
        Option "InvertY" "on"

So this maybe results from using an rotated framebuffer together with tslib. fbturbo uses a shadow framebuffer to realize the rotation.

Edit: It’s the same when I use a hardware mouse via x2x
Edit: confused upside down and clockwise
« Last Edit: September 22, 2017, 03:42:46 PM by SR-Digitronic »

SR-Digitronic

  • Newbie
  • *
  • Posts: 13
  • Karma: +1/-0
Re: How to rotate display including mouse cursor on
« Reply #3 on: September 22, 2017, 04:38:34 PM »
I finally got it fixed!

When you e.g. select a rectangle the upper left corner of the rectangle does not match the mouse position.

If you want Xorg to draw the cursor: (Cursor is where the click happens and gets displayed rotated)
Code: [Select]
        Option          "HWCursor" "false"
you select it in a totally different direction opposite to your real mouse movements.

This needs some changes in /usr/share/X11/xorg.conf.d/90-calibration.conf

90° / CW:
Code: [Select]
Option "InvertY" "on"
Option "SwapAxes" "1"

180° / UD:
Code: [Select]
Option "InvertX" "on"
Option "InvertY" "on"

If it is still a bit off, try
Code: [Select]
su olimex -c "DISPLAY=:0.0 xinput_calibrator"
Important: xinput_calibrator does not permanently change your X settings, you have to manually write it to 90-calibration.conf
« Last Edit: September 22, 2017, 04:40:44 PM by SR-Digitronic »

att2

  • Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: How to rotate display including mouse cursor on
« Reply #4 on: December 12, 2018, 08:08:11 PM »
Hello,
I still have the same problem: The mouse cursor is not rotated.
Moving the mouse I can see that the mouse system "believes" it is working in non-rotated mode.
The symptoms of this unwanted behaviour are as following: I cannot move the mouse cursor up to the upper/left edge of the screen. The upper/left edge is displaced by Y coordinate approximately 400 pixels (my guess).
Even if I can move the mouse around (in a wrong way) and if I click on a button or window, the clicked area is displaced from the locaction on the screen by seveal hundred pixels. I cannot click on the "start" button, because this is displaced.
I have tried everything that is written in here: a) edit xorg.conf with hwcursor false
b) edit 90-calibration.conf with all sort of options (rotate ccw, etc.)
c) change option calibration values

Nothing helped. So please, please help me again, the mouse cursor problem is really annoying.

I am using a real mouse connected on the USB port and not the touch screen.