저는 저항막 방식 터치스크린이 탑재된 7인치 디스플레이, ARM CPU가 내장된 Linux를 사용하고 있습니다. 제조사 Engicam, 디자인은 Freescale/NXP i.MX6 Sabre 보드와 유사합니다.
Yocto 1.7.3과 Engicam 보드 지원 패키지를 사용하여 기본적으로 Firefox 브라우저인 X11 애플리케이션을 만들었습니다. 이 앱은 한 가지 예외를 제외하고 대부분 작동합니다. 어떤 항목도 탭/클릭할 수 없습니다. 화면을 터치하고 움직이면 커서가 손가락을 따라가는데, 아쉽게도 한 번 클릭이나 두 번 클릭이 작동하지 않습니다.
내 구성:
핵심: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 이벤트를 볼 수 없는 이유는 무엇입니까? 이것은 구성 문제입니까, 아니면 버그입니까?
클릭 이벤트를 얻는 방법은 무엇입니까?