wiki.brainux.org/_posts/2021-12-04-tips-touch-panel.md

108 lines
2.4 KiB
Markdown
Raw Normal View History

2021-12-04 19:33:31 +09:00
---
title: タッチパネル
categories:
2021-12-07 17:47:00 +09:00
- Tips
2021-12-04 19:33:31 +09:00
- Linux
tags:
- Linux
- GUI
- 周辺機器
2021-12-07 18:15:23 +09:00
excerpt: タッチパネルのキャリブレーションBrainux に同梱されているため手動インストールは不要)
2021-12-04 19:33:31 +09:00
---
# 事前に
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
Xorgの設定ファイル ( xorg.conf )を設定していない場合は、下記のWikiを参照して設定してください。
2021-12-04 20:29:17 +09:00
[Xorg](/linux/linux-xorg/)
2021-12-04 19:33:31 +09:00
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# 必要なパッケージのインストール
2022-01-12 02:54:15 +09:00
```sh
2021-12-04 19:33:31 +09:00
apt install xserver-xorg-input-evdev xinput-calibrator
```
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
を実行して、必要なパッケージをインストールします。
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# Xorgとopenboxの起動
2022-01-12 02:54:15 +09:00
```sh
2021-12-04 19:33:31 +09:00
Xorg &
openbox-session &
```
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
を実行して、Xorgとopenboxを起動します。
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# タッチパネル補正ツールの起動
2022-01-12 02:54:15 +09:00
```sh
2021-12-04 19:33:31 +09:00
xinput_calibrator
```
画面上に補正画面が表示されます。
![xinput-calibratorの画面](/assets/images/xinput-calibrator.png)
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# 補正する
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
画面上の 赤い十字 を**丁寧に** 4回タッチすると、補正用の設定項目が端末に出力されます。
2022-01-12 02:54:15 +09:00
```plaintext
2021-12-04 19:33:31 +09:00
Setting calibration data: 0, 4095, 0, 4095
Calibrating EVDEV driver for "mxs-lradc-ts" id=6
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
Doing dynamic recalibration:
Setting calibration data: 147, 3618, 3826, 350
--> Making the calibration permanent <--
copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's)
Section "InputClass"
Identifier "calibration"
MatchProduct "mxs-lradc-ts"
Option "Calibration" "147 3618 3826 350"
Option "SwapAxes" "0"
EndSection
2022-01-12 02:54:15 +09:00
```
2021-12-04 19:33:31 +09:00
# 設定ファイルを作成・保存する
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
`/etc/X11/xorg.conf.d`を作成します。
2022-01-12 02:54:15 +09:00
```sh
2022-08-19 23:53:52 +09:00
mkdir /etx/X11/xorg.conf.d
2021-12-04 19:33:31 +09:00
```
xinput_calibratorの出力に従って、`/etc/X11/xorg.conf.d/99-calibration.conf`に
`Section "InputClass"` から `EndSection`までの行を nano や vi を用いて書き出します。
2022-01-12 02:54:15 +09:00
```plaintext
2021-12-04 19:33:31 +09:00
Section "InputClass"
Identifier "calibration"
MatchProduct "mxs-lradc-ts"
Option "Calibration" "147 3618 3826 350"
Option "SwapAxes" "0"
EndSection
```
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# Xorgの再起動
2022-01-12 02:54:15 +09:00
```sh
2021-12-04 19:33:31 +09:00
pkill Xorg
Xorg &
openbox-session &
```
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
でXorgを再起動します。
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
# 完成
2022-01-12 02:54:15 +09:00
2021-12-04 19:33:31 +09:00
![ちゃんとタッチした場所にカーソルが来ています](/assets/images/calibrator-done.gif)