1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ubuntu: マウス・タッチパッドの入力軸を回転

Last updated at Posted at 2020-07-01

terminalで以下を実行

左90度回転
xinput set-prop 13 'Coordinate Transformation Matrix' 0 -1 0 1 0 0 0 0 1
xrandr -o left
右90度回転
xinput set-prop 13 'Coordinate Transformation Matrix' 0 1 0 -1 0 0 0 0 1
xrandr -o right
180度回転
xinput set-prop 13 'Coordinate Transformation Matrix' -1 0 0 0 -1 0 0 0 1
xrandr -o inverted 
0度に戻す
xinput set-prop 13 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
xrandr -o normal

上記コマンド中13は各端末のデバイスidに書き換える。
デバイスidは、以下のように、xinputコマンドで確認可能。

kinomi@pop-os:xinput

⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad              	id=13	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Power Button                            	id=6	[slave  keyboard (3)]
    ↳ Video Bus                               	id=7	[slave  keyboard (3)]
    ↳ Power Button                            	id=8	[slave  keyboard (3)]
    ↳ Sleep Button                            	id=9	[slave  keyboard (3)]
    ↳ Topre Corporation HHKB Professional     	id=10	[slave  keyboard (3)]
    ↳ HD Webcam: HD Webcam                    	id=11	[slave  keyboard (3)]
    ↳ MSI WMI hotkeys                         	id=14	[slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard            	id=12	[slave  keyboard (3)]

任意の角度に回転

1 0 0 0 1 0 0 0 1 部分を書き換える
これは行列を表す
回転角度0の場合
| 1 0 0 |
| 0 1 0 |
| 0 0 1 |

反時計回りにθ回転の場合は、
| cosθ -sinθ 0 |
| sinθ cosθ 0 |
| 0 0 1 |
cos -sin 0 sin cos 0 0 0 1に書き換える

関連する数学

アファイン変換(affine transformation)

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?