Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Touchscreen on raspberry: problem with events
Touchscreen on raspberry: problem with events [message #48625] Wed, 09 August 2017 16:16 Go to previous message
Giorgio is currently offline  Giorgio
Messages: 218
Registered: August 2015
Experienced Member
Hi there,
I am porting an application developed with U++ on Windows to a raspberry platform. The raspberry is a Pi 3 Model B, with the latest noobs/raspbian as operating system. The raspberry has attached a EloTouch touch screen, recognized by the kernel as a Amtel maXTouch Digitzer (probably elotouch just rebrand Amtel touchscreen). The driver used is the evdev driver.

The porting of the application was really quick: less than 20 lines of codes changed and the application was up and running on the raspberry. I tested the application with mouse and keyboard and it works as expected. Problems come in with the touch screen.

For some reason, my application does not recognize correctly the "tap". I had this problem both with buttons (more details here) and with Switch control (more details here). I guess that the problem is how upp treats the event (below there are more information on this, that I collected using evtest utility; basically, mouse uses BTN_LEFT event for the click, while the touch screen uses BTN_TOUCH for the tap). This is what works and what does not work in my application:
-Tap/click: it works only with WhenPush or WhenAction callbacks, not with the built-in event (e.g. standard Ok and Cancel buttons do not work, but if I explicitly set the WhenPush callback they work as described here)
-Double click/tap: it works (e.g. double clicking/taping on a row of a SqlArray control gets in edit mode)
-Right click emulation: it does not work (keeping pressed should triggers the right click emulation, but if I keep pressing on a SqlArray row it does not show the "Modify record..." pop up, as it happens if I right click with the mouse)
-multi-touch: not tested

On the OS all the above events (click/tap, double click/tap, right click emulation, multi touch) are treated correctly, so I guess that the problem is on U+++ side.

As I said, I guess is a problem related to the events: I tried to have a look to CtrLib/Switch.cpp and CtrLib/Switch.cpp, but I am not skilled enough to understand if they can be somehow fixed.

I think I cannot solve by myself those problems, so any help will be appreciated.
Thanks,
Gio

More information on the mouse and touch click event:

pi@raspberrypi:~ $ sudo evtest /dev/input/event2 
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x192f product 0x416 version 0x111
Input device name: "USB Optical Mouse"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 273 (BTN_RIGHT)
    Event code 274 (BTN_MIDDLE)
  Event type 2 (EV_REL)
    Event code 0 (REL_X)
    Event code 1 (REL_Y)
    Event code 6 (REL_HWHEEL)
    Event code 8 (REL_WHEEL)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)






Event: time 1502281968.518936, -------------- EV_SYN ------------
Event: time 1502281968.646926, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1502281968.646926, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0
Event: time 1502281968.646926, -------------- EV_SYN ------------




pi@raspberrypi:~ $ sudo evtest /dev/input/event3
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x3eb product 0x8a6e version 0x111
Input device name: "Atmel Atmel maXTouch Digitizer"
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   1078
      Min        0
      Max     4095
      Resolution      12
    Event code 1 (ABS_Y)
      Value   3218
      Min        0
      Max     4095
      Resolution      15
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        9
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min        0
      Max     4095
      Resolution      12
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min        0
      Max     4095
      Resolution      15
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)



Event: time 1502282136.626462, -------------- EV_SYN ------------
Event: time 1502282136.703407, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value -1
Event: time 1502282136.703407, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1502282136.703407, -------------- EV_SYN ------------


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help wanted for DebugVisualizer
Next Topic: Upp as a shared library
Goto Forum:
  


Current Time: Sun Oct 24 17:30:05 CEST 2021

Total time taken to generate the page: 0.01049 seconds