Quantcast
Channel: bitWalk's
Viewing all articles
Browse latest Browse all 804

【備忘録】タッチスクリーンと Linux

$
0
0

Linux でタッチスクリーン(タッチパネル)を使うときにおぼえておきたい情報を備忘録としてまとめました。

本ブログ記事で使用する PC は、大変古いものになりますが、ASUS TransBook T100HA(以降、単に T100HA とします)です。もう 3 年以上前のモデルです。

買った当初は Ubuntu をインストールして、画面の向きを変えるのに悪戦苦闘しましたが [1]、いつからか、画面の縦横向きの自動に変更されるようになり、Linux のタブレット PC として利用できるようになりました。

バッテリーがくたびれてきていますが、今でも現役で、主に Linux のタッチスクリーン動作確認用のテスト機として使っています。

使用した OS 環境は下記の通りです。

Fedora 33 Workstationx86_64

※ ブログ記事を書いている時点では Fedora 33 はまだベータ版です。

右は Firefox で仮想キーボードを表示させた T100HA の写真です。Firefox の場合、キーボードを切り離せば、文字入力時に仮想キーボードを利用できます。普段使っている Google Chrome では同じ仮想キーボードが表示されませんが、仮想キーボードの拡張機能を利用できます。しかし、残念ながら使いやすいものがありませんでした。そういうわけで、タッチスクリーンを操作する場合は、ブラウザには Firefox を使っています。

xinput

xinput はマウス・キーボード・タッチパッドなど Xの入力デバイスを設定およびテストするためのユーティリティです。Fedora では xorg-x11-server-utilsパッケージに含まれています。


[bitwalk@t100ha ~]$ xinput --list
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ xwayland-pointer:17 id=6 [slave pointer (2)]
⎜ ↳ xwayland-relative-pointer:17 id=7 [slave pointer (2)]
⎜ ↳ xwayland-touch:17 id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ xwayland-keyboard:17 id=8 [slave keyboard (3)]
[bitwalk@t100ha ~]$

デバイス id 9 を指定すると詳細な情報が表示されます。


[bitwalk@t100ha ~]$ xinput --list 9
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
xwayland-touch:17 id=9 [slave pointer (2)]
Reporting 4 classes:
Class originated from: 9. Type: XIButtonClass
Buttons supported: 1
Button labels: None
Button state:
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 0:
Label: Abs MT Position X
Range: 0.000000 - 65535.000000
Resolution: 10000 units/m
Mode: absolute
Current value: 0.000000
Class originated from: 9. Type: XIValuatorClass
Detail for Valuator 1:
Label: Abs MT Position Y
Range: 0.000000 - 65535.000000
Resolution: 10000 units/m
Mode: absolute
Current value: 0.000000
Class originated from: 9. Type: XITouchClass
Touch mode: direct
Max number of touches: 20

[bitwalk@t100ha ~]$

--list-propsオプションで、デバイスのプロパティを表示できます。


[bitwalk@t100ha ~]$ xinput --list-props 9
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
Device 'xwayland-touch:17':
Device Enabled (119): 1
Coordinate Transformation Matrix (121): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (244): 0
Device Accel Constant Deceleration (245): 1.000000
Device Accel Adaptive Deceleration (246): 1.000000
Device Accel Velocity Scaling (247): 10.000000
[bitwalk@t100ha ~]$

libinput

libinput は Waylandコンポジタで入力デバイスを処理するためのライブラリで、汎用的な X.Org入力ドライバーでもあります。


[bitwalk@t100ha ~]$ sudo libinput list-devices
[sudo] bitwalk のパスワード:
Device: Power Button
Kernel: /dev/input/event3
Group: 1
Seat: seat0, default
Capabilities: keyboard
...
(途中省略)
...
Rotation: n/a

Device: SIS0457:00 0457:113D
Kernel: /dev/input/event8
Group: 8
Seat: seat0, default
Size: 136x216mm
Capabilities: touch
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: identity matrix
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Accel profiles: n/a
Rotation: n/a

Device: Intel HID events
Kernel: /dev/input/event10
Group: 9
Seat: seat0, default
Capabilities: keyboard
...
(途中省略)
...
Rotation: n/a

[bitwalk@t100ha ~]$

参考サイト

  1. bitWalk's: ASUS TransBook T100HA と Ubuntu 17.10 [2017-11-12]
  2. libinput (freedesktop.org)

ブログランキング・にほんブログ村へ
にほんブログ村

Viewing all articles
Browse latest Browse all 804

Trending Articles