[No1.Linux2020/x86_64] x11-touchscreen-calibrator-0.2-1no1linux.2020

by No1Linuxer posted Mar 07, 2020
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

가 크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form
RPM Filename x11-touchscreen-calibrator-0.2-1no1linux.2020.x86_64.rpm
Category KDE
SRPM x11-touchscreen-calibrator-0.2-1no1linux.2020.src.rpm
Note x11-touchscreen-calibrator

X Window System’s Touchscreen Calibrator

터치스크린 시스템에서 이 도구를 실행하면 해상도가 변경될 때 즉 화면이 회전될때(해상도가 달라지므로) 그에 상응하는 Coordinate transformation matrix 값을 측정해서 알려 줍니다. 이렇게 측정된 Coordinate transformation matrix 값을 xinput로 수정해 주면 터치스크린의 회전 방향을 올바르게 설정할 수 있습니다.

x11-touchscreen-calibrator

X Window System’s Touchscreen Calibrator

X11 Touchscreen Calibrator runs as a daemon in the background. It will detect the touchscreen automatically and adjust the corresponding Coordinate Transformation Matrix of Touchscreen xinput when the resolution is changed. It should also support rotation, reflection and different scaling modes of display output.


Coordinate Transformation Matrix

Zoom

Restrict the cursor movement within the left half side of the touchscreen display.

⎡ 0.5 , 0 , 0 ⎤
⎜ 0   , 1 , 0 ⎥
⎣ 0   , 0 , 1 ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 0.5 0 0 0 1 0 0 0 1

Restrict the cursor movement within the top half side of the touchscreen display.

⎡ 1 , 0   , 0 ⎤
⎜ 0 , 0.5 , 0 ⎥
⎣ 0 , 0   , 1 ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 0 0 0.5 0 0 0 1

Map the cursor movement to the left half touchscreen area.

⎡ 2 , 0 , 0 ⎤
⎜ 0 , 1 , 0 ⎥
⎣ 0 , 0 , 1 ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 2 0 0 0 1 0 0 0 1

Map the cursor movement to the top half touchscreen area.

⎡ 1 , 0 , 0 ⎤
⎜ 0 , 2 , 0 ⎥
⎣ 0 , 0 , 1 ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 0 0 2 0 0 0 1

Translation

Make the cursor shift right by half the width of the touchscreen.

⎡ 1 ,  0 ,  0.5 ⎤
⎜ 0 ,  1 ,  0   ⎥
⎣ 0 ,  0 ,  1   ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 0.5 0 1 0 0 0 1

Make the cursor shift left by half the width of the touchscreen.

⎡ 1 ,  0 ,  -0.5 ⎤
⎜ 0 ,  1 ,   0   ⎥
⎣ 0 ,  0 ,   1   ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 -0.5 0 1 0 0 0 1

Make the cursor shift down by half the height of the touchscreen.

⎡ 1 ,  0 ,  0   ⎤
⎜ 0 ,  1 ,  0.5 ⎥
⎣ 0 ,  0 ,  1   ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 0 0 1 0.5 0 0 1

Make the cursor shift up by half the height of the touchscreen.

⎡ 1 ,  0 ,   0   ⎤
⎜ 0 ,  1 ,  -0.5 ⎥
⎣ 0 ,  0 ,   1   ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 1 0 0 0 1 -0.5 0 0 1

Zoom x Translation

For example, if we want the center 1/4 area of the touchscreen to operate the fullscreen cursor movement.

⎡ 2 , 0 , 0 ⎤   ⎡ 1 , 0 , 0 ⎤   ⎡ 1 ,  0 ,  -0.25 ⎤   ⎡ 1 ,  0 ,   0    ⎤
⎜ 0 , 1 , 0 ⎥ X ⎜ 0 , 2 , 0 ⎥ X ⎜ 0 ,  1 ,   0    ⎥ X ⎜ 0 ,  1 ,  -0.25 ⎥
⎣ 0 , 0 , 1 ⎦   ⎣ 0 , 0 , 1 ⎦   ⎣ 0 ,  0 ,   1    ⎦   ⎣ 0 ,  0 ,   1    ⎦

equals to

⎡ 2 , 0 , 0 ⎤   ⎡ 1 ,  0 ,  -0.25 ⎤
⎜ 0 , 2 , 0 ⎥ X ⎜ 0 ,  1 ,  -0.25 ⎥
⎣ 0 , 0 , 1 ⎦   ⎣ 0 ,  0 ,   1    ⎦

equals to

⎡ 2 , 0 , -0.5 ⎤
⎜ 0 , 2 , -0.5 ⎥
⎣ 0 , 0 ,  1   ⎦

$ xinput set-prop ‘<device name>’ ‘Coordinate Transformation Matrix’ 2 0 -0.5 0 2 -0.5 0 0 1

Scaling mode

The touchscreen display may support four different modes, such as ‘None’, ‘Full’, ‘Center’ and ‘Full aspect’.

pw = preferred width
ph = preferred height
(The preferred resolution of touchscreen display.)

sw = screen width
sh = screen height
(The virtual screen of X Window System.)

dw = display width
dh = display height
dx = display X axis
dy = display Y axis
(The actual resolution and position of touchscreen display.)

‘None’ mode

The behavior is undefined. It may work like ‘Full’ mode or ‘Center’ mode.

‘Full’ mode

⎡ dw / sw ,  0       ,  dx / sw ⎤
⎜ 0       ,  dh / sh ,  dy / sh ⎥
⎣ 0       ,  0       ,  1       ⎦

equals to

⎡ 1 ,  0 ,  dx / sw ⎤   ⎡ dw / sw , 0       , 0 ⎤
⎜ 0 ,  1 ,  dy / sh ⎥ X ⎜ 0       , dh / sh , 0 ⎥
⎣ 0 ,  0 ,  1       ⎦   ⎣ 0       , 0       , 1 ⎦

‘Center’ mode

⎡ pw / dw ,  0       ,  (dw - pw) / sw / 2 + dx / sw ⎤
⎜ 0       ,  ph / sh ,  (dh - ph) / sh / 2 + dy / sh ⎥
⎣ 0       ,  0       ,  1                            ⎦

equals to

⎡ dw / sw ,  0       ,  dx / sw ⎤   ⎡ pw / dw , 0       , (dw - pw) / dw / 2 ⎤
⎜ 0       ,  dh / sh ,  dy / sh ⎥ X ⎜ 0       , ph / dh , (dh - ph) / dh / 2 ⎥
⎣ 0       ,  0       ,  1       ⎦   ⎣ 0       , 0       , 1                  ⎦

equals to

⎡ dw / sw ,  0       ,  dx / sw ⎤   ⎡ pw / dw , 0       , 0 ⎤   ⎡ 1 , 0 , - (1 - dw / pw) / 2 ⎤
⎜ 0       ,  dh / sh ,  dy / sh ⎥ X ⎜ 0       , ph / dh , 0 ⎥ X ⎜ 0 , 1 , - (1 - dh / ph) / 2 ⎥
⎣ 0       ,  0       ,  1       ⎦   ⎣ 0       , 0       , 1 ⎦   ⎣ 0 , 0 , 1                   ⎦

‘Full aspect’ mode

(with left and right side blank)

⎡ pw * dh / ph / sw ,  0       ,  (1 - pw * dh / ph / dw) * dw / sw / 2 + dx / sw ⎤
⎜ 0                 ,  dh / sh ,  dy / sh                                         ⎥
⎣ 0                 ,  0       ,  1                                               ⎦

equals to

⎡ dw / sw ,  0       ,  dx / sw ⎤   ⎡ pw * dh / ph / dw , 0 , (1 - pw * dh / ph / dw) / 2 ⎤
⎜ 0       ,  dh / sh ,  dy / sh ⎥ X ⎜ 0                 , 1 , 0                           ⎥
⎣ 0       ,  0       ,  1       ⎦   ⎣ 0                 , 0 , 1                           ⎦

equals to

⎡ dw / sw ,  0       ,  dx / sw ⎤   ⎡ pw * dh / ph / dw , 0 , 0 ⎤   ⎡ 1 , 0 , (ph * dw / pw / dh - 1) / 2 ⎤
⎜ 0       ,  dh / sh ,  dy / sh ⎥ X ⎜ 0                 , 1 , 0 ⎥ X ⎜ 0 , 1 , 0                           ⎥
⎣ 0       ,  0       ,  1       ⎦   ⎣ 0                 , 0 , 1 ⎦   ⎣ 0 , 0 , 1                           ⎦

Rotation

$ xrandr -o left

⎡ 0 -1 1 ⎤
⎜ 1  0 0 ⎥
⎣ 0  0 1 ⎦

$ xrandr -o right

⎡  0 1 0 ⎤
⎜ -1 0 1 ⎥
⎣  0 0 1 ⎦

$ xrandr -o inverted

⎡ -1  0 1 ⎤
⎜  0 -1 1 ⎥
⎣  0  0 1 ⎦

Reflection

$ xrandr -x

⎡ -1 0 1 ⎤
⎜  0 1 0 ⎥
⎣  0 0 1 ⎦

$ xrandr -y

⎡ 1  0 0 ⎤
⎜ 0 -1 1 ⎥
⎣ 0  0 1 ⎦

Articles

10 11 12 13 14 15 16 17 18 19