can't get touch-events from touchscreen



Hi all,

I have a PiTFT, a 2.8" capacitive touchscreen for the Raspberry Pi on
raspbian (gtk 3.10.x). It works perfect, except that I only receive button
events, and I fail to receive touch events. Also kinetic scrolling is not
working. What can I do to fix this?

I tried various things to get more information. This is what is reported in
Xorg.log:

[   486.549] (II) config/udev: Adding input device stmpe-ts
(/dev/input/event0)
[   486.549] (**) stmpe-ts: Applying InputClass "evdev touchscreen catchall"
[   486.549] (**) stmpe-ts: Applying InputClass "calibration"
[   486.550] (II) LoadModule: "evdev"
[   486.552] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[   486.553] (II) Module evdev: vendor="X.Org Foundation"
[   486.553]    compiled for 1.12.1, module version = 2.7.0
[   486.553]    Module class: X.Org XInput Driver
[   486.553]    ABI class: X.Org XInput driver, version 16.0
[   486.553] (II) Using input driver 'evdev' for 'stmpe-ts'
[   486.554] (**) stmpe-ts: always reports core events
[   486.554] (**) evdev: stmpe-ts: Device: "/dev/input/event0"
[   486.555] (--) evdev: stmpe-ts: Vendor 0 Product 0
[   486.555] (--) evdev: stmpe-ts: Found absolute axes
[   486.555] (--) evdev: stmpe-ts: Found x and y absolute axes
[   486.555] (--) evdev: stmpe-ts: Found absolute touchscreen
[   486.555] (**) Option "SwapAxes" "1"
[   486.556] (II) evdev: stmpe-ts: Configuring as touchscreen
[   486.556] (**) Option "EmulateThirdButton" "1"
[   486.556] (**) Option "EmulateThirdButtonTimeout" "750"
[   486.557] (**) Option "EmulateThirdButtonMoveThreshold" "30"
[   486.557] (**) evdev: stmpe-ts: YAxisMapping: buttons 4 and 5
[   486.557] (**) evdev: stmpe-ts: EmulateWheelButton: 4,
EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[   486.558] (**) Option "config_info"
"udev:/sys/devices/soc/20204000.spi/spi_master/spi0/spi0.1/stmpe-ts/input/input0/event0"
[   486.558] (II) XINPUT: Adding extended input device "stmpe-ts" (type:
TOUCHSCREEN, id 6)
[   486.559] (II) evdev: stmpe-ts: initialized for absolute axes.
[   486.561] (**) stmpe-ts: (accel) keeping acceleration scheme 1
[   486.561] (**) stmpe-ts: (accel) acceleration profile 0
[   486.561] (**) stmpe-ts: (accel) acceleration factor: 2.000
[   486.561] (**) stmpe-ts: (accel) acceleration threshold: 4
[   486.565] (II) config/udev: Adding input device stmpe-ts
(/dev/input/mouse0)
[   486.565] (**) stmpe-ts: Applying InputClass "calibration"

It seems that X does detect a touchscreen. The event also seems to generate
touch events, evtest shows touch events, pressure and absolute positioning
which I think correspond to a touchscreen:

$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:    stmpe-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: "stmpe-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   3014
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value   2942
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
Testing ... (interrupt to exit)
Event: time 1445753599.628119, type 3 (EV_ABS), code 0 (ABS_X), value 1681
Event: time 1445753599.628119, type 3 (EV_ABS), code 1 (ABS_Y), value 2933
Event: time 1445753599.628119, type 3 (EV_ABS), code 24 (ABS_PRESSURE),
value 113
Event: time 1445753599.628119, type 1 (EV_KEY), code 330 (BTN_TOUCH),
value 1
Event: time 1445753599.628119, -------------- SYN_REPORT ------------
Event: time 1445753599.637296, type 3 (EV_ABS), code 0 (ABS_X), value 1639
Event: time 1445753599.637296, type 3 (EV_ABS), code 1 (ABS_Y), value 2967
Event: time 1445753599.637296, type 3 (EV_ABS), code 24 (ABS_PRESSURE),
value 131

If I call device.get_source() after a button press event, I get  <enum
GDK_SOURCE_MOUSE of type GdkInputSource>

If I add touch events with eventbox.add_events(Gdk.EventMask.TOUCH_MASK)
and connect to the touch-event I get no callback calls.

If I try the example code from
http://www.digitaloctave.com/pages/gtk3/tutorial14.htm I don't get a touch
output either..

So what could be wrong, and how could this be fixed?

Thank you for any help on this matter

Olivier


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]