Touch support Qt5 widget application

I’m using ubuntu 14.04 installed in VM, Toradex version 2.6, Colibri evaluation board and i.MX7S.

I’m working with angstrom-qt5-x11-image and a Qt5 widget only application.

I need to configure two type of touch panel: one resistive and one capacitive.

Resistive touch: ok, image is displayed and touch events are used by qt application.

Capacitive touch (ic controller sitronix 1633i): following Capacitive Multi-Touch Display, image is displayed but touch event are not used by qt application.

Using evtest, output is:

root@colibri-imx7:~# evtest                                                     
No device specified, trying to scan all of /dev/input/event*                    
Available devices:                                                              
/dev/input/event0:      st1633i-touchscreen                                     
/dev/input/event1:      gpio-keys                                               
Select the device event number [0-1]: 0                                         
Input driver version is 1.0.1                                                   
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0                    
Input device name: "st1633i-touchscreen"                                        
Supported events:                                                               
  Event type 0 (EV_SYN)                                                         
  Event type 1 (EV_KEY)                                                         
  Event type 3 (EV_ABS)                                                         
    Event code 48 (ABS_MT_TOUCH_MAJOR)                                          
      Value      0                                                              
      Min        0                                                              
      Max      255                                                              
    Event code 53 (ABS_MT_POSITION_X)                                           
      Value      0                                                              
      Min        0                                                              
      Max      799                                                              
    Event code 54 (ABS_MT_POSITION_Y)                                           
      Value      0                                                              
      Min        0                                                              
      Max      479                                                              
Properties:                                                                     
Testing ... (interrupt to exit)                                                 
Event: time 1477410927.229868, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), val
ue 589                                                                          
Event: time 1477410927.229868, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), val
ue 250                                                                          
Event: time 1477410927.229868, ++++++++++++++ SYN_MT_REPORT ++++++++++++        
Event: time 1477410927.229868, -------------- SYN_REPORT ------------           
Event: time 1477410927.241652, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), val
ue 589                                                                          
Event: time 1477410927.241652, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), val
ue 250                                                                          
Event: time 1477410927.241652, ++++++++++++++ SYN_MT_REPORT ++++++++++++        
Event: time 1477410927.241652, -------------- SYN_REPORT ------------           
Event: time 1477410927.253336, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), val
ue 589                                                                          
Event: time 1477410927.253336, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), val
ue 250                                                                          
Event: time 1477410927.253336, ++++++++++++++ SYN_MT_REPORT ++++++++++++        
Event: time 1477410927.253336, -------------- SYN_REPORT ------------           
Event: time 1477410927.288264, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), val
ue 589                                                                          
Event: time 1477410927.288264, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), val
ue 249                                                                          
Event: time 1477410927.288264, ++++++++++++++ SYN_MT_REPORT ++++++++++++        
Event: time 1477410927.288264, -------------- SYN_REPORT ------------           
Event: time 1477410927.311788, ++++++++++++++ SYN_MT_REPORT ++++++++++++        
Event: time 1477410927.311788, -------------- SYN_REPORT ------------  

Then touch events seems to be processed by the kernel but not by the qt application.

What am i missing in the touch capacitive configuration?

Thanks for any help you can give

Since you use the angstrom-qt5-x11-image image, I am assuming that you use Qt5 on-top of X11. The evtest utility checks the input on kernel input subsystem level, which seems to work fine. The next level to I recommend to check is X11. Check your xorg logs ( /var/log/Xorg.0.log ). You might to have to add a InputClass section to /etc/X11/xorg.conf similar to http://developer.toradex.com/knowledge-base/capacitive-multi-touch-display-(linux)#Configure_XServer

Also it seems that your touch screen driver only reports multi touch events. The Fusion driver is a bit different, it always reports a set of events which allow to use it as a single touch/pointer device… Altough I think evdev should handle your situation nowadays, but you might want to check the xorg logs carefully.

I already added “InputClass” section to /etc/X11/xorg.conf but reading /var/log/Xorg.0.log i have found that input class is not recognized.
Thanks for the advice, now it is fixed (this is an extract of the log).

[4294111.526] (II) config/udev: Adding input device st1633i_ts (/dev/input/event0)
[4294111.527] (**) st1633i_ts: Applying InputClass "Sitronix 1633i"
[4294111.527] (II) Using input driver 'evdev' for 'st1633i_ts'
[4294111.527] (**) st1633i_ts: always reports core events
[4294111.527] (**) evdev: st1633i_ts: Device: "/dev/input/event0"
[4294111.527] (II) evdev: st1633i_ts: Using mtdev for this device
[4294111.528] (--) evdev: st1633i_ts: Vendor 0 Product 0
[4294111.528] (--) evdev: st1633i_ts: Found absolute axes
[4294111.528] (--) evdev: st1633i_ts: Found absolute multitouch axes
[4294111.528] (II) evdev: st1633i_ts: No buttons found, faking one.
[4294111.528] (II) evdev: st1633i_ts: Forcing relative x/y axes to exist.
[4294111.528] (II) evdev: st1633i_ts: Configuring as mouse
[4294111.528] (**) evdev: st1633i_ts: YAxisMapping: buttons 4 and 5
[4294111.529] (**) evdev: st1633i_ts: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[4294111.529] (**) Option "config_info" "udev:/sys/devices/platform/soc/30800000.aips-bus/30a50000.i2c/i2c-3/3-0055/input/input0/event0"
[4294111.529] (II) XINPUT: Adding extended input device "st1633i_ts" (type: MOUSE, id 7)
[4294111.529] (II) evdev: st1633i_ts: Faking axis ABS_X.
[4294111.529] (II) evdev: st1633i_ts: Faking axis ABS_Y.
[4294111.530] (II) evdev: st1633i_ts: initialized for absolute axes.
[4294111.531] (**) st1633i_ts: (accel) keeping acceleration scheme 1
[4294111.531] (**) st1633i_ts: (accel) acceleration profile 0
[4294111.531] (**) st1633i_ts: (accel) acceleration factor: 2.000
[4294111.531] (**) st1633i_ts: (accel) acceleration threshold: 4

Now a strange thing with my qt widget app:

  • pressing with only one finger, nothing happen
  • adding a pression with a second finger, the cursor follow the pression of the second finger

Event of both fingers are recognized by evtest but only the second finger is recognized by qt app.

Thanks for any advide you can give. (actually i’m checking the st1633 driver)

Fixed, two parameters are missing in the driver:

  • ABS_MT_TOUCH_MAJOR
  • ABS_MT_WIDTH_MAJOR

Now it work properly.

Thanks for update! Yeah in multi-touch world the events and event attributes are quite crucial. Most multi-touch driver come from the Android world, which follow(ed) slightly different standards.

The kernel has quite nice documentation about multi-touch protocol:

https://www.kernel.org/doc/Documentation/input/multi-touch-protocol.txt