私は抵抗膜方式タッチスクリーンが搭載された7インチディスプレイ、ARM CPUが内蔵されたLinuxを使用しています。メーカーEngicam、デザインはFreescale/NXP i.MX6 Sabreボードに似ています。
Yocto 1.7.3とEngicamボードサポートパッケージを使用して、デフォルトでFirefoxブラウザであるX11アプリケーションを作成しました。このアプリは、1つの例外を除いてほとんど動作します。どの項目もタブ/クリックできません。画面をタッチして動かすと、カーソルは指をたどりますが、残念ながらワンクリックまたはダブルクリックは機能しません。
私の設定:
コア:Linux display 3.10.17-1.0.2_ga+g33597e3 #1 SMP PREEMPT Sun May 22 20:00:34 CEST 2016 armv7l GNU/Linux
抵抗膜タッチドライバ:max11801_ts
とイベントドライバevdev
。
/usr/share/X11/xorg.conf.d/10-evdev.conf
evdev() の設定ファイル:
#
# Catch-all evdev loader for udev-based systems
# We don't simply match on any device since that also adds accelerometers
# and other devices that we don't really want to use. The list below
# matches everything but joysticks.
Section "InputClass"
Identifier "evdev pointer catchall"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "evdev keyboard catchall"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "evdev touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "evdev tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection
Section "InputClass"
Identifier "evdev touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "SHMConfig" "true"
Option "TapButton1" "1"
Option "EmulateThirdButton" "1"
Option "EmulateThirdButtonTimeout" "750"
Option "EmulateThirdButtonMoveThreshold" "30"
Option "Calibration" "0 4095 0 4095"
EndSection
最後の部分はevdevのタッチスクリーンに使用されます。
X11ログでは、X11がevdevをロードして設定を受け入れることを確認できます。
X11ログの一部(/var/log/Xorg.0.log
):
[3738325.274] (**) max11801_ts: Applying InputClass "evdev touchscreen catchall"
[3738325.274] (II) LoadModule: "evdev"
[3738325.275] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[3738325.289] (II) Module evdev: vendor="X.Org Foundation"
[3738325.289] compiled for 1.14.4, module version = 2.9.0
[3738325.289] Module class: X.Org XInput Driver
[3738325.289] ABI class: X.Org XInput driver, version 19.1
[3738325.289] (II) Using input driver 'evdev' for 'max11801_ts'
[3738325.290] (**) max11801_ts: always reports core events
[3738325.293] (**) evdev: max11801_ts: Device: "/dev/input/event0"
[3738325.294] (--) evdev: max11801_ts: Vendor 0 Product 0
[3738325.295] (--) evdev: max11801_ts: Found absolute axes
[3738325.295] (--) evdev: max11801_ts: Found x and y absolute axes
[3738325.295] (--) evdev: max11801_ts: Found absolute touchscreen
[3738325.295] (II) evdev: max11801_ts: Configuring as touchscreen
[3738325.296] (**) Option "EmulateThirdButton" "1"
[3738325.296] (**) Option "EmulateThirdButtonTimeout" "750"
[3738325.296] (**) Option "EmulateThirdButtonMoveThreshold" "30"
[3738325.297] (**) evdev: max11801_ts: YAxisMapping: buttons 4 and 5
[3738325.297] (**) evdev: max11801_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[3738325.297] (**) Option "config_info" "udev:/sys/devices/soc0/soc.1/2100000.aips-bus/21a0000.i2c/i2c-0/0- 0048/input/input0/event0"
[3738325.297] (II) XINPUT: Adding extended input device "max11801_ts" (type: TOUCHSCREEN, id 6)
[3738325.299] (II) evdev: max11801_ts: initialized for absolute axes.
[3738325.300] (**) max11801_ts: (accel) keeping acceleration scheme 1
[3738325.301] (**) max11801_ts: (accel) acceleration profile 0
[3738325.301] (**) max11801_ts: (accel) acceleration factor: 2.000
[3738325.301] (**) max11801_ts: (accel) acceleration threshold: 4
[3738325.305] (II) config/udev: Adding input device max11801_ts (/dev/input/mouse0)
[3738325.305] (II) No input driver specified, ignoring this device.
[3738325.305] (II) This device may have been added with another device file.
xinputはタッチデバイスも見ることができます:
# xinput list
| Virtual core pointer id=2 [master pointer (3)]
| > Virtual core XTEST pointer id=4 [slave pointer (2)]
| > max11801_ts id=6 [slave pointer (2)]
| Virtual core keyboard id=3 [master keyboard (2)]
| Virtual core XTEST keyboard id=5 [slave keyboard (3)]
残念ながら、evtestはクリック(EV_KEY)(BTN_TOUCH)イベントを表示しません。
# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: max11801_ts
Select the device event number [0-0]: 0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "max11801_ts"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 1308
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 476
Min 0
Max 4095
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 1
Properties:
Testing ... (interrupt to exit)
Event: time 1464027536.266584, type 3 (EV_ABS), code 0 (ABS_X), value 1167
Event: time 1464027536.266584, type 3 (EV_ABS), code 1 (ABS_Y), value 2282
Event: time 1464027536.266584, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 1
Event: time 1464027536.266584, -------------- EV_SYN ------------
Event: time 1464027536.282916, type 3 (EV_ABS), code 0 (ABS_X), value 1168
Event: time 1464027536.282916, -------------- EV_SYN ------------
Event: time 1464027536.299472, type 3 (EV_ABS), code 0 (ABS_X), value 1169
Event: time 1464027536.299472, -------------- EV_SYN ------------
Event: time 1464027536.315900, type 3 (EV_ABS), code 0 (ABS_X), value 1171
Event: time 1464027536.315900, type 3 (EV_ABS), code 1 (ABS_Y), value 2281
Event: time 1464027536.315900, -------------- EV_SYN ------------
Event: time 1464027536.340587, type 3 (EV_ABS), code 0 (ABS_X), value 1172
Event: time 1464027536.340587, -------------- EV_SYN ------------
Event: time 1464027536.348821, type 3 (EV_ABS), code 0 (ABS_X), value 1173
Event: time 1464027536.348821, -------------- EV_SYN ------------
Event: time 1464027536.357047, type 3 (EV_ABS), code 0 (ABS_X), value 1174
Event: time 1464027536.357047, type 3 (EV_ABS), code 1 (ABS_Y), value 2283
Event: time 1464027536.357047, -------------- EV_SYN ------------
Event: time 1464027536.365190, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0
Event: time 1464027536.365190, -------------- EV_SYN ------------
テスト完了いいえEV_KEY /BTN_TOUCHイベントを確認してください。
もう少し調べたところ、ts_testでBTN_TOUCHイベントを見ることができることがわかりました。
# TSLIB_TSDEVICE=/dev/input/touchscreen0 ts_test
1464048778.716232: 399 239 1
1464048778.724452: 399 239 1
1464048778.732621: 399 239 1
1464048778.740965: 399 238 1
1464048778.749177: 399 237 1
1464048778.757422: 399 236 0
最後の列が BTN_TOUCH イベントであると仮定します。
私もxinput_calibratorを試しました
# xinput_calibrator
Calibrating EVDEV driver for "max11801_ts" id=6
current calibration values (from XInput): min_x=0, max_x=4095 and min_y=0, max_y=4095
左上に十字線が表示され、十字線をペンでタッチすると、カーソルはこの位置に移動しますが、xinput_calibrator
クリックイベントは発生しません。
Firefoxにも同じ問題があります。どのアイテムもクリック/クリックできません。
evtestがBTN_TOUCHイベントを表示できないのはなぜですか?これは設定の問題ですか、それともバグですか?
クリックイベントを取得するには?