Open metasoma opened 5 years ago
It locates at screen above of real finger- and pen pointing.
This is something I had not heard about before, that is interesting! So the general rotation does work, you just have a slight offset?
If you would draw an arrow between your pen and the cursor, what would this look like? Is it just a constant offset like this?
Or is it that the offset gets larger or smaller when you go up and down?
Or is the offset in one direction but gets larger when you move in some other direction, so like this?
In any of these cases we should be able to find some transformation matrix that compensates for that. Perhaps also one of the calibration tools from the Wacom driver package helps you.
Thanks for your quick response. The offset gets larger or smaller when I go up and down. At the bottom of screen the cursor matches the finger/pen. Going upwards will draw the cursor fast upwards, mispointing the finger/pen.
I gave the calibration tool a try. Unfortunately the configuration-screen is not completely viewable in right-rotated screen (high format). Only the two crosses on the left are touchable, the right section goes out of screen. So configuration can't be completed in right-rotated mode.
Or do you have other suggestions?
I edited this info above:
Rotation and Mouse-Input works well, but the TOUCH-SCREEN- and PEN-Inputs are pointing at the wrong place on screen when rotated** by cmd thinkpad-rotate right
. At the bottom screen the cursor matches the finger/pen. Moving the finger/pen upwards, the cursor runs above real finger pointing.
When I rotate by thinkpad-rotate flip
everything works fine.
Beside that I get this error entering:
thinkpad-rotate flip
or thinkpad-rotate right
tps.screen WARNING gsettings is installed, but the "org.gnome.settings-daemon.plugins.xsettings" schema is not available
tps.vkeyboard WARNING kvkbd is not installed
The two warnings do not matter here.
Okay, so it sounds like the rotation-translation matrix has an incorrect scaling factor. Do you have any external screens attached?
You say that in rotated-right-mode the cursor is above the pen. Is it perfectly above the pen or maybe slightly to one side as well? If that was the case we would have to incorporate the aspect ratio of the device with the rotation matrix.
But it seems that we do not use a rotation matrix on your system, we use the xsetwacom
utility.
tps.input INFO Device 12 has “Wacom Rotation” property, use xsetwacom.
So it seems that this does something funny.
Could you install the latest master
branch and try adding this to your configuration file:
[input]
use_xsetwacom_if_available = false
Then try again. Perhaps xsetwacom
does something strange.
Where do I get the latest master-branch? I got thinkpad-scripts_4.11.0.orig or is it better to install from thinkpad-scripts_4.11.0-0ubuntu1.debian.tar.xz or thinkpad-scripts_4.11.0-0ubuntu1_all.deb as deepin is based on debian?
Is it a failure to have installed your think-rotate_3.2.orig.tar.gz or thinkpad-scripts_4.11.0-0ubuntu1.debian.tar.xz / think-rotate_3.2-0ubuntu4.debian.tar.xz in addition? I downloaded those, but I'm not sure if I've installed them month ago. So is there a way to uninstall them separately and reinstall the correct one for Deepin 15.9?
I don't have an external screen attached. The cursor is ar correct position, when I point the bottom. By moving it upwards the cursor will fade quick ahead of the touch/pen.
VIDEO 1 https://youtu.be/kYgFNL5GNRM
after editing /home/x230t-deepin/.config/thinkpad-scripts
as you recommend, the cursor points in different ways on the screen:
[input]
use_xsetwacom_if_available = false
1) It moves as shown in the following video (Screen is in desptop-position) So it seems to mirror the pen-position around a special point.
VIDEO 2 https://youtu.be/5oUU4EVixgo
2) after relaunching the thinkpad-rotate right
several times with same config.ini
- use_xsetwacom_if_available = false
the cursor-behavior is as without this configuration.
see VIDEO 1
The behavior in the second video is peculiar. We might be able to cure that with a rotation matrix, but then we will have to disable xsetwacom
.
The second video looks like your screen got rotated clockwise but the input got rotated counter-clockwise. This could be strange interplay between xsetwacom
. If you have freshly started the system and just called thinkpad-rotate right
with this use_xsetwacom_if_available = false
, do you get the behavior of video 1 or video 2, or something different?
I tested again with restarted system an thinkpad-rotate right
with this use_xsetwacom_if_available = false
. I got a different result now. Might be because of deactivation of magic-rotation commands? I was able to reproduce this behavior several times:
I gave output to xrandr -q --verbose
with and without setting use_xsetwacom_if_available = false
after running thinkpad-rotate right
It said Transform has the same values rotated to right:
xrandr -q --verbose
Screen 0: minimum 320 x 200, current 768 x 1366, maximum 8192 x 8192
LVDS-1 connected primary 768x1366+0+0 (0x49) right (normal left inverted right x axis y axis) 277mm x 156mm
Identifier: 0x42
Timestamp: 1934112
Subpixel: horizontal rgb
Gamma: 1.0:1.4:1.9
Brightness: 1.0
Clones:
CRTC: 0
CRTCs: 0 1 2
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
and rotated to normal:
xrandr -q --verbose
Screen 0: minimum 320 x 200, current 1366 x 768, maximum 8192 x 8192
LVDS-1 connected primary 1366x768+0+0 (0x49) normal (normal left inverted right x axis y axis) 277mm x 156mm
Identifier: 0x42
Timestamp: 1306642
Subpixel: horizontal rgb
Gamma: 1.0:1.4:1.9
Brightness: 1.0
Clones:
CRTC: 0
CRTCs: 0 1 2
Transform: 1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
If my understanding is right, that transformation matrix is set to
1 0 0 0 1 0 0 0 1
and doesn't change when rotating, perhaps there is the error?
Then I found these values for transformation matrix of X230-T (via https://gist.github.com/vext01/7012073)
# Transformation matricies
MTX_LEFT="0 -1 1 1 0 0 0 0 1"
MTX_RIGHT="0 1 0 -1 0 1 0 0 1"
MTX_INVERTED="-1 0 1 0 -1 1 0 0 1"
MTX_NORMAL="1 0 0 0 1 0 0 0 1"
Following this, it seems transformation matrix is not set correctly when rotating with thinkpad-rotate. Is it possible to do a change of transformatin matrix with thinkpad-rotate?
The rotation matrices are straightforward to generate. To rotate by an angle φ you create the matrix as such:
cos(φ) -sin(φ) 0
sin(φ) cos(φ) 0
0 0 1
One then has to be careful with active and passive transformation, but that is equivalent to changing the direction of rotation. The values are these:
φ / deg | cos(φ) | sin(φ) |
---|---|---|
0 | 1 | 0 |
90 | 0 | 1 |
180 | -1 | 0 |
270 | 0 | -1 |
If the off-diagonal elements in the last column and last row are non-zero, one gets a translation. Depending on the axis of rotation that is indeed needed.
However, there are five things at play here:
xinput
rotation of the input devicexinput
rotation matrix of the input devicexsetwacom
rotation of the Wacom deviceAs far as I understand xrandr
, this rotation matrix is applied additionally to the general rotation (like right
in your example). We can therefore either use the general rotation or the rotation matrix to rotate the output as needed.
For the input devices we will have to find out which of the tree things causes the unwanted scaling effect. From your latest video I conclude that the culprit is not xsetwacom
but something with xinput
directly. Could you give me the output of thinkpad-rotate -vv --force-direction cw
? I want to see whether it applies the general rotation or the rotation matrix.
I get following output
x230t-deepin@x230t-deepin:~$ thinkpad-rotate -vv --force-direction cw
tps.config DEBUG ----------------------------------
tps.config DEBUG Program was started with arguments: ['/usr/local/bin/thinkpad-rotate', '-vv', '--force-direction', 'cw']
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.screen DEBUG subprocess “xrandr”
tps.screen DEBUG Screens available on this system are LVDS-1.
tps.screen DEBUG Internal screen is determined to be LVDS-1.
tps.screen DEBUG subprocess “xrandr -q --verbose”
tps DEBUG Converted “normal” to “Direction(xrandr='normal', xsetwacom='none', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps.screen INFO Current rotation is “Direction(xrandr='normal', xsetwacom='none', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps DEBUG Converted “cw” to “Direction(xrandr='right', xsetwacom='cw', subpixel='vbgr', physically_closed=True, rot_mat=[0, 1, 0, -1, 0, 1, 0, 0, 1])”.
tps.rotate INFO User chose to set to Direction(xrandr='right', xsetwacom='cw', subpixel='vbgr', physically_closed=True, rot_mat=[0, 1, 0, -1, 0, 1, 0, 0, 1])
tps DEBUG Command “/home/x230t-deepin/.config/thinkpad-scripts/hooks/prerotate” not found.
tps.screen DEBUG subprocess “xrandr --output LVDS-1 --rotate right”
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.screen DEBUG subprocess “xrandr -q”
tps.input DEBUG Translation and scaling matrix: [[ 1.00000 0.00000 0.00000 ][ 0.00000 1.00000 0.00000 ][ 0.00000 0.00000 1.00000 ]]
tps.input DEBUG Complete transformation matrix: [[ 0.00000 1.00000 0.00000 ][ -1.00000 0.00000 1.00000 ][ 0.00000 0.00000 1.00000 ]]
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.input DEBUG Using “Wacom ISD.*id=(\d+)” as regex to find Wacom devices.
tps.input DEBUG subprocess “xinput”
tps.input INFO Mapping and rotating all input devices.
tps.input DEBUG subprocess “xinput --list-props 12”
tps.input DEBUG Device 12 has property “Wacom Rotation”
tps.input INFO Device 12 has “Wacom Rotation” property, use xsetwacom.
tps.input DEBUG subprocess “xsetwacom set 12 rotate cw”
tps.input DEBUG subprocess “xsetwacom set 12 MapToOutput LVDS-1”
tps.input DEBUG subprocess “xinput --list-props 11”
tps.input DEBUG Device 11 has property “Wacom Rotation”
tps.input INFO Device 11 has “Wacom Rotation” property, use xsetwacom.
tps.input DEBUG subprocess “xsetwacom set 11 rotate cw”
tps.input DEBUG subprocess “xsetwacom set 11 MapToOutput LVDS-1”
tps.input DEBUG subprocess “xinput --list-props 17”
tps.input DEBUG Device 17 has property “Wacom Rotation”
tps.input INFO Device 17 has “Wacom Rotation” property, use xsetwacom.
tps.input DEBUG subprocess “xsetwacom set 17 rotate cw”
tps.input DEBUG subprocess “xsetwacom set 17 MapToOutput LVDS-1”
tps.screen DEBUG subprocess “xrandr”
tps DEBUG Command “xfconf-query” not found.
tps DEBUG Command “gsettings” found.
tps.screen DEBUG subprocess “gsettings list-schemas”
tps.screen WARNING gsettings is installed, but the "org.gnome.settings-daemon.plugins.xsettings" schema is not available
tps.vkeyboard DEBUG subprocess “pgrep kvkbd”
tps DEBUG Command “kvkbd” not found.
tps.vkeyboard WARNING kvkbd is not installed
tps.input DEBUG subprocess “xinput list”
tps.input DEBUG subprocess “xinput set-prop 15 'Device Enabled' 0”
tps.input DEBUG subprocess “xinput list”
tps.input DEBUG subprocess “xinput set-prop 14 'Device Enabled' 0”
tps DEBUG Command “/home/x230t-deepin/.config/thinkpad-scripts/hooks/postrotate” not found.
It still uses xsetwacom
. Didn't you set use_xsetwacom_if_available = false
?
ah, sorry. Here my output with xsetwacom = false
x230t-deepin@x230t-deepin:~$ thinkpad-rotate -vv --force-direction cw
tps.config DEBUG ----------------------------------
tps.config DEBUG Program was started with arguments: ['/usr/local/bin/thinkpad-rotate', '-vv', '--force-direction', 'cw']
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.screen DEBUG subprocess “xrandr”
tps.screen DEBUG Screens available on this system are LVDS-1.
tps.screen DEBUG Internal screen is determined to be LVDS-1.
tps.screen DEBUG subprocess “xrandr -q --verbose”
tps DEBUG Converted “normal” to “Direction(xrandr='normal', xsetwacom='none', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps.screen INFO Current rotation is “Direction(xrandr='normal', xsetwacom='none', subpixel='rgb', physically_closed=False, rot_mat=[1, 0, 0, 0, 1, 0, 0, 0, 1])”.
tps DEBUG Converted “cw” to “Direction(xrandr='right', xsetwacom='cw', subpixel='vbgr', physically_closed=True, rot_mat=[0, 1, 0, -1, 0, 1, 0, 0, 1])”.
tps.rotate INFO User chose to set to Direction(xrandr='right', xsetwacom='cw', subpixel='vbgr', physically_closed=True, rot_mat=[0, 1, 0, -1, 0, 1, 0, 0, 1])
tps DEBUG Command “/home/x230t-deepin/.config/thinkpad-scripts/hooks/prerotate” not found.
tps.screen DEBUG subprocess “xrandr --output LVDS-1 --rotate right”
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.screen DEBUG subprocess “xrandr -q”
tps.input DEBUG Translation and scaling matrix: [[ 1.00000 0.00000 0.00000 ][ 0.00000 1.00000 0.00000 ][ 0.00000 0.00000 1.00000 ]]
tps.input DEBUG Complete transformation matrix: [[ 0.00000 1.00000 0.00000 ][ -1.00000 0.00000 1.00000 ][ 0.00000 0.00000 1.00000 ]]
tps.config DEBUG Default configfile is /home/x230t-deepin/.cache/Python-Eggs/thinkpad_scripts-4.11.0-py3.6.egg-tmp/tps/default.ini.
tps.input DEBUG Using “Wacom ISD.*id=(\d+)” as regex to find Wacom devices.
tps.input DEBUG subprocess “xinput”
tps.input INFO Mapping and rotating all input devices.
tps.input DEBUG subprocess “xinput --list-props 12”
tps.input DEBUG Device 12 has property “Wacom Rotation”
tps.input INFO Device 12 does not have “Wacom Rotation” property, use xinput and try xsetwacom.
tps.input DEBUG subprocess “xinput set-prop 12 'Coordinate Transformation Matrix' 0.0 1.0 0.0 -1.0 0.0 1.0 0.0 0.0 1.0”
tps.input DEBUG subprocess “xinput --list-props 11”
tps.input DEBUG Device 11 has property “Wacom Rotation”
tps.input INFO Device 11 does not have “Wacom Rotation” property, use xinput and try xsetwacom.
tps.input DEBUG subprocess “xinput set-prop 11 'Coordinate Transformation Matrix' 0.0 1.0 0.0 -1.0 0.0 1.0 0.0 0.0 1.0”
tps.input DEBUG subprocess “xinput --list-props 17”
tps.input DEBUG Device 17 has property “Wacom Rotation”
tps.input INFO Device 17 does not have “Wacom Rotation” property, use xinput and try xsetwacom.
tps.input DEBUG subprocess “xinput set-prop 17 'Coordinate Transformation Matrix' 0.0 1.0 0.0 -1.0 0.0 1.0 0.0 0.0 1.0”
tps.screen DEBUG subprocess “xrandr”
tps DEBUG Command “xfconf-query” not found.
tps DEBUG Command “gsettings” found.
tps.screen DEBUG subprocess “gsettings list-schemas”
tps.screen WARNING gsettings is installed, but the "org.gnome.settings-daemon.plugins.xsettings" schema is not available
tps.vkeyboard DEBUG subprocess “pgrep kvkbd”
tps DEBUG Command “kvkbd” not found.
tps.vkeyboard WARNING kvkbd is not installed
tps.input DEBUG subprocess “xinput list”
tps.input DEBUG subprocess “xinput set-prop 15 'Device Enabled' 0”
tps.input DEBUG subprocess “xinput list”
tps.input DEBUG subprocess “xinput set-prop 14 'Device Enabled' 0”
tps DEBUG Command “/home/x230t-deepin/.config/thinkpad-scripts/hooks/postrotate” not found.
And in the case without xsetwacom
you have the problem that the cursor is above the pen.
Could you just try this in the command line after rotating to the right? You need to first find out the correct number from xinput
.
xinput set-prop 12 'Coordinate Transformation Matrix' 0.0 1.0 0.0 -0.5 0.0 1.0 0.0 0.0 1.0
I have tried that on my machine and it makes the cursor be below the pen (and getting worse as I move). This might fix the problem (or we need a slightly different number).
I tried this command with your given values, but didn't see a difference. Do I have to change the values, and how can I detect them? Is it about calibration?
Maybe I asked the wrong way - sorry for my basic english.
I wanted to ask, if there is a possibilitie to find out the right values for 'Coordinate Transformation Matrix'
.
Is it purposeful to use a calibration-tool like those you recommended earlier (https://github.com/linuxwacom/xf86-input-wacom/wiki/Calibration)?
And in the case without
xsetwacom
you have the problem that the cursor is above the pen.Could you just try this in the command line after rotating to the right? You need to first find out the correct number from
xinput
.xinput set-prop 12 'Coordinate Transformation Matrix' 0.0 1.0 0.0 -0.5 0.0 1.0 0.0 0.0 1.0
I have tried that on my machine and it makes the cursor be below the pen (and getting worse as I move). This might fix the problem (or we need a slightly different number).
Could you explain the function of every single value? Possibly I could adjust it by trial-and-error.
@metasoma This might be helpful to understand the matrix: https://wiki.ubuntu.com/X/InputCoordinateTransformation
I would expect to see a change if you run the command @martin-ueding provided after rotating the screen. Just make sure you use the correct device ID (12
in the example @martin-ueding provided). Based on the output you provided for xinput list
, the stylus has ID of 11
, the stylus eraser has ID of 17
, and the touch screen has ID of 12
. You'll want to run the command for each of these IDs to adjust each device. (You may need to run xinput list
again to get new IDs if you've restarted your computer, because in my experience the IDs can change after a restart.)
I basically got thinkpad-scrips to work on X230 Tablet running Deepin 15.9 After I went through configuration, there is still an issue with input devices.
Rotation and Mouse-Input works well, but the TOUCH-SCREEN- and PEN-Inputs are pointing at the wrong place on screen when rotated by cmd
thinkpad-rotate right
. At the bottom screen the cursor matches the finger/pen. Moving the finger/pen upwards, the cursor runs above real finger pointing. When I rotate bythinkpad-rotate flip
everything works fine.Beside that I get this error entering:
thinkpad-rotate flip
orthinkpad-rotate flip
Can you give me an advide how to fix this issue? I would really appreciate help, maybe anybody is experienced in this?
Here are some more outputs, that might be helpful to iditify the problem. I really don't know what to do, to fix it.
@martin-ueding