Armadilloフォーラム

タッチスクリーンの認識について

hondah

2016年9月22日 19時35分

いつもお世話になっております。
使用環境
ATDE5-20160225
Atmark-dist-20151026
linux-3.4.at17
Armadillo-840(1GB版)
タッチスクリーン TMH-310-AC00(HDMI+USB接続)

上記のタッチスクリーンと840を接続し、
Qtのサンプルプログラムを動かした所、タッチイベントが拾えておりません。
Armadillo、Qt共に初心者なのでわかりやすく教えてもらえないでしょうか?

①起動したときにプログラム動かしたいため、抜き差ししないでも画面が表示するにはどうしたらよいのか。
②タッチイベントを拾うにはどうしたらよいのか。

実施内容

必要と思われるドライバーを有効化し、イメージを作成
Device Drivers
HID Devices
[*] HID Multitouch panels
USB support
[*] USB LCD driver support
USB Serial Converter support
[*] USB FTDI Single Port Serial Driver
Input device support
Touchscreens
[*] USB Touchscreen Driver
[*] DMC TSC-10/25 device support

Armadillo840へ書き込み。

evtestにてタッチイベントが取得できていることを確認。
[root@armadillo840-0 (ttySC2) ~]# evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0xafa product 0x3e8 version 0x200
Input device name: "TSC-30 DMC"
Supported events:
Event type 0 (Sync)
Event type 1 (Key)
Event code 330 (Touch)
Event type 3 (Absolute)
Event code 0 (X)
Value 870
Min 0
Max 1023
Event code 1 (Y)
Value 922
Min 0
Max 1023
Testing ... (interrupt to exit)
Event: time 946688915.195496, type 1 (Key), code 330 (Touch), value 1
Event: time 946688915.195504, type 3 (Absolute), code 0 (X), value 163
Event: time 946688915.195508, type 3 (Absolute), code 1 (Y), value 353
Event: time 946688915.195512, -------------- Report Sync ------------
Event: time 946688915.202474, type 3 (Absolute), code 0 (X), value 162
Event: time 946688915.202480, type 3 (Absolute), code 1 (Y), value 354
Event: time 946688915.202484, -------------- Report Sync ------------
Event: time 946688915.209484, type 3 (Absolute), code 0 (X), value 161
Event: time 946688915.209489, type 3 (Absolute), code 1 (Y), value 355
Event: time 946688915.209493, -------------- Report Sync ------------
Event: time 946688915.216472, type 3 (Absolute), code 1 (Y), value 356
Event: time 946688915.216477, -------------- Report Sync ------------
Event: time 946688915.236474, type 3 (Absolute), code 1 (Y), value 357
Event: time 946688915.236479, -------------- Report Sync ------------
Event: time 946688915.249469, type 3 (Absolute), code 0 (X), value 162
Event: time 946688915.249474, type 3 (Absolute), code 1 (Y), value 358
Event: time 946688915.249478, -------------- Report Sync ------------
Event: time 946688915.256471, type 3 (Absolute), code 0 (X), value 163
Event: time 946688915.256475, type 3 (Absolute), code 1 (Y), value 359
Event: time 946688915.256479, -------------- Report Sync ------------
Event: time 946688915.269471, type 3 (Absolute), code 1 (Y), value 361
Event: time 946688915.269476, -------------- Report Sync ------------
Event: time 946688915.290473, type 3 (Absolute), code 0 (X), value 159
Event: time 946688915.290478, type 3 (Absolute), code 1 (Y), value 362
Event: time 946688915.290482, -------------- Report Sync ------------
Event: time 946688915.296471, type 3 (Absolute), code 0 (X), value 157
Event: time 946688915.296477, -------------- Report Sync ------------
Event: time 946688915.316467, type 1 (Key), code 330 (Touch), value 0
Event: time 946688915.316475, -------------- Report Sync ------------

サンプルプログラムである/usr/share/qt5/photoviewer/photoviewer.qmlを実行。
すると、液晶画面の表示がされておりません。HDMIを抜き差しすることで表示されました。
しかしタッチパネルを押しても反応なし。
実行結果は下記の通りになっております。(maxが0になっているのが原因?)

[root@armadillo840-0 (ttySC2) ~]# qmlscene /usr/share/qt5/photoviewer/photoviewer.qml
evdevtouch: Using device /dev/input/event0
min X: 0 max X: 0
min Y: 0 max Y: 0
min pressure: 0 max pressure: 0
device name: TSC-30 DMC
Protocol type B (mtdev)

コメント

at_ito

2016年10月4日 16時48分

伊藤です。

以下のブログでTSC-44を接続した際の動作手順がかかれています。

https://users.atmark-techno.com/blog/53/2252

tslibで動かすところ等が参考になるかと思いますので、
試してみてください。