Touchscreen on a Raspberry Pi

I’ve installed OF on a Raspberry Pi and want to use an Elo touchscreen for display and event triggering. When the RPi is operating in the windows mode, the touchscreen works and a touch moves the “arrow” and appears to register as a mouse-click event. When I run a simple OF app on the RPi the video is fine but the touch no longer works - though the app runs as designed using the mouse. I’ve run the same app using a MacBook Pro and the Elo touchscreen and it works. Elo tech support suggests it is an OF problem.

I’ve explored the use of ofTouchEvents but to no avail as the online documentation is minimal.

Any suggestions would be appreciated !

1 Like

On my adafruit TFT happens the same, have you solved it?

I have continued to explore this issue but have not resolved it. I have written Processing apps using the RPi and Elo touchscreen and they work but no luck with OF. Sorry!

Have you tried with the most recent master on github? I wonder if its a bug from poco or whatever the equivalent handler was on the pi that the new implementation in 0.9.0 might address or fix

Hi all, I believe the problem is that the ELO / Adafruit touch screen does not report its touch events via the normal mouse event device that we are listening to in our ofAppEGLWindow.

In the following section we are reading the native mouse events:

and we are telling it the mouse device path here:

The problem is, IIRC, is that the touch screen on the ELO (and Adafruit) does not pass it’s mouse events using the event-mouse device name. We filter for that here:

It works on X11 because they are probably using a much less naive mouse event filter than was originally implemented.

I would recommend the following procedure to correct it:

  1. Confirm the actual device name that the ELO/adafruit TFT screen is using to send its mouse events.
  2. If it is isn’t using our default (i.e. event-mouse), then investigate the event file system using the command line and determine the device that it is actually using. Be aware that it may actually show up as a keyboard or something strange (this has happened to me with mouse events coming from an Arduino before).
  3. Once you determine the source of the TFT’s mouse events, modify the mouse-filter to pick up that device.
  4. If that doesn’t work, make sure that it is sending the mouse events that we are looking for in readNativeMouseEvents(). They may be slightly different and you may have to modify the logic in that method. Once you connect to the correct tft-touch device using the correct file-descriptor, you can either log the raw data coming from those events, or you might just find a one of the various linux utilities that will allow you to listen to system events on the command line. evtest (a linux utility) is a good place to start.

OK. Good luck and I’ll try to keep up with this post … unfortunately I don’t have my TFT hooked up so I’ll be as helpful as possible.

2 Likes

Also, just for cross-reference, check out this thread if you haven’t. piTFT adafruit tft+touchscreen

Thanks for the suggestion. I intend to follow bakercp’s suggestions first and will report the outcome. Then if necessary will consider the new master.

@DomAmato and @retprof I doubt the new master branch will change this behavior. There aren’t significant changes in the ofAppEGLWindow. AFAIK, Poco / ofEvent has / had little to do with the problem. Poco would be happy to pass along the mouse / touch events if we package them up and sent them – that’s how we are doing it now – the problem is deeper in that we aren’t actually listening for and processing the appropriate events from the touch screen b/c we aren’t listening to the right device.

Thanks for this! I’ve looked through the oF code you linked, run evtest, and get the following for the touch events:

“pi@raspberrypi:~ $ evtest /dev/input/event2
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x4d8 product 0xc02 version 0x111
Input device name: “Microchip Technology Inc. AR1100 HID-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 3 (EV_ABS)
Event code 0 (ABS_X)
Value 670
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 2043
Min 0
Max 4095
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing … (interrupt to exit)
Event: time 1437035286.162216, type 3 (EV_ABS), code 0 (ABS_X), value 1881
Event: time 1437035286.162216, type 3 (EV_ABS), code 1 (ABS_Y), value 1650
Event: time 1437035286.162216, -------------- SYN_REPORT ------------
Event: time 1437035286.178222, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001
Event: time 1437035286.178222, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1
etc…”

which looks like it gets handled in the “ofAppEGLWindow::readNativeMouseEvents()” block?

Just FYI, for the keyboard events I see:

“pi@raspberrypi:~ $ evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc52b version 0x111
Input device name: “Logitech USB Receiver”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)

Event: time 1437038409.782332, type 2 (EV_REL), code 0 (REL_X), value 2
Event: time 1437038409.782332, -------------- SYN_REPORT ------------
Event: time 1437038409.798344, type 2 (EV_REL), code 0 (REL_X), value 2
etc…”

And for the mouse events I see:

“pi@raspberrypi:~ $ evtest /dev/input/event1
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc52b version 0x111
Input device name: “Logitech USB Receiver”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)

Event: time 1437038925.380939, type 2 (EV_REL), code 0 (REL_X), value 1
Event: time 1437038925.380939, type 2 (EV_REL), code 1 (REL_Y), value -1
Event: time 1437038925.380939, -------------- SYN_REPORT ------------
Event: time 1437038925.396940, type 2 (EV_REL), code 0 (REL_X), value 6
etc…”

Essentially the same output as the keyboard, since the mouse and keyboard both share a single wifi dongle (which I suppose is not really relevant to the main issue at hand anyway, but there you go :blush: ).

So at this juncture I’m just not sure: 1) how to interpret what I’m seeing in the touch screen output, or 2) what to do in relation to it, even with your helpful points.

Once I identify the device name (which I’m assuming is “Microchip Technology Inc. AR1100 HID-MOUSE”), do I do a version of what jvcleave suggests in the other thread and extend ofAppEGLWindow or copy ofAppEGLWindow.cpp into my project’s src folder and rename it, and/or change the “event-mouse” ref within “filter_mouse” to the input device name listed in evtest?

Thanks in advance as always for any additional pointers!

So just to clarify – you believe that the touch-screen mouse events are coming through the device “/dev/input/event2” ? If so, then the next step would probably be to replace

with

if(d->d_type != DT_DIR && string_ends_with(d->d_name,"event2")) {

And cross your fingers and see what happens :smile:

It will likely disable the logitech usb / mouse in openFrameworks, as it will only listen to one at a time (with the current code) – but at least it moves us closer …

Also – what is the contents of your /dev/input/ directory? (you can see it with ls -la of course). Could you paste the contents here? Do it a couple times, once with the usb mouse / keyboard plugged in and once without. (just trying to isolate the exact device that represents the touch input).

In my case, mouse events also seem to come through /dev/input/event2.
I’ve tested to change event-mouse to event2 but doesn’t works, I’ve got that messages through console:

[notice] of AppEGLWindow: setupMouse(): unabled to find mouse
[error ] of AppEGLWindow: setupMouse(): did not open mouse
[error ] of AppEGLWindow: setupMouse(): did not open mouse, mouse_fd<0

:confused:

I’ve been trying to get something useful, maybe this could help for mouse_filter

First of all, the input devices list: kbd, mouse and TFT

pi@raspberrypi /dev/input/by-path $ cat /proc/bus/input/devices

I: Bus=0003 Vendor=24ae Product=2000 Version=0101
N: Name="RAPOO RAPOO 2.4G Wireless Device"
P: Phys=usb-bcm2708_usb-1.2/input0
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:24AE:2000.0001/input/input0
U: Uniq=
H: Handlers=sysrq kbd event0 
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=24ae Product=2000 Version=0101
N: Name="RAPOO RAPOO 2.4G Wireless Device"
P: Phys=usb-bcm2708_usb-1.2/input1
S: Sysfs=/devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:24AE:2000.0002/input/input1
U: Uniq=
H: Handlers=kbd mouse0 event1 
B: PROP=0
B: EV=1f
B: KEY=3f 3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1f0001 120f93 8b17c000 677bfa d941dfed 9ed680 4400 0 10000002
B: REL=1c3
B: ABS=1 0
B: MSC=10

I: Bus=0018 Vendor=0000 Product=0000 Version=0000
N: Name="stmpe-ts"
P: Phys=stmpe-ts/input0
S: Sysfs=/devices/soc/20204000.spi/spi_master/spi0/spi0.1/stmpe-ts/input/input2
U: Uniq=
H: Handlers=mouse1 event2 
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

Now the list of dev/input (with all connected):

pi@raspberrypi /dev $ ls -la
total 4
drwxr-xr-x 13 root root        3300 Jul 24 13:35 .
drwxr-xr-x 22 root root        4096 May  7 01:30 ..
crw-------  1 root root     10, 235 Jan  1  1970 autofs
drwxr-xr-x  2 root root         580 Jan  1  1970 block
crw------T  1 root root     10, 234 Jan  1  1970 btrfs-control
drwxr-xr-x  3 root root          60 Jan  1  1970 bus
crw-------  1 root root     10,  63 Jan  1  1970 cachefiles
drwxr-xr-x  2 root root        2560 Jul 24 13:35 char
crw-------  1 root root      5,   1 Jul 24 13:35 console
crw-------  1 root root     10,  62 Jan  1  1970 cpu_dma_latency
crw------T  1 root root     10, 203 Jan  1  1970 cuse
drwxr-xr-x  6 root root         120 Jan  1  1970 disk
crw-rw---T  1 root video    29,   0 Jan  1  1970 fb0
crw-rw---T  1 root video    29,   1 Jul 24 14:40 fb1
lrwxrwxrwx  1 root root          13 Jan  1  1970 fd -> /proc/self/fd
crw-rw-rw-  1 root root      1,   7 Jan  1  1970 full
crw-rw---T  1 root fuse     10, 229 Jan  1  1970 fuse
crw-------  1 root root    249,   0 Jan  1  1970 hidraw0
crw-------  1 root root    249,   1 Jan  1  1970 hidraw1
drwxr-xr-x  4 root root         220 Jul 24 13:35 input
crw-r--r--  1 root root      1,  11 Jan  1  1970 kmsg
srw-rw-rw-  1 root root           0 Jul 24 13:35 log
brw-rw---T  1 root disk      7,   0 Jan  1  1970 loop0
brw-rw---T  1 root disk      7,   1 Jan  1  1970 loop1
brw-rw---T  1 root disk      7,   2 Jan  1  1970 loop2
brw-rw---T  1 root disk      7,   3 Jan  1  1970 loop3
brw-rw---T  1 root disk      7,   4 Jan  1  1970 loop4
brw-rw---T  1 root disk      7,   5 Jan  1  1970 loop5
brw-rw---T  1 root disk      7,   6 Jan  1  1970 loop6
brw-rw---T  1 root disk      7,   7 Jan  1  1970 loop7
crw-------  1 root root     10, 237 Jan  1  1970 loop-control
lrwxrwxrwx  1 root root          13 Jan  1  1970 MAKEDEV -> /sbin/MAKEDEV
drwxr-xr-x  2 root root          60 Jan  1  1970 mapper
crw-r----T  1 root kmem      1,   1 Jan  1  1970 mem
crw-------  1 root root     10,  59 Jan  1  1970 memory_bandwidth
brw-rw---T  1 root floppy  179,   0 Jan  1  1970 mmcblk0
brw-rw---T  1 root floppy  179,   1 Jul 24 13:35 mmcblk0p1
brw-rw---T  1 root floppy  179,   2 Jul 24 13:35 mmcblk0p2
drwxr-xr-x  2 root root          60 Jan  1  1970 net
crw-------  1 root root     10,  61 Jan  1  1970 network_latency
crw-------  1 root root     10,  60 Jan  1  1970 network_throughput
crw-rw-rw-  1 root root      1,   3 Jan  1  1970 null
crw-------  1 root root    108,   0 Jan  1  1970 ppp
crw-rw-rw-  1 root root      5,   2 Jul 24 14:56 ptmx
drwxr-xr-x  2 root root           0 Jan  1  1970 pts
brw-rw---T  1 root disk      1,   0 Jan  1  1970 ram0
brw-rw---T  1 root disk      1,   1 Jan  1  1970 ram1
brw-rw---T  1 root disk      1,  10 Jan  1  1970 ram10
brw-rw---T  1 root disk      1,  11 Jan  1  1970 ram11
brw-rw---T  1 root disk      1,  12 Jan  1  1970 ram12
brw-rw---T  1 root disk      1,  13 Jan  1  1970 ram13
brw-rw---T  1 root disk      1,  14 Jan  1  1970 ram14
brw-rw---T  1 root disk      1,  15 Jan  1  1970 ram15
brw-rw---T  1 root disk      1,   2 Jan  1  1970 ram2
brw-rw---T  1 root disk      1,   3 Jan  1  1970 ram3
brw-rw---T  1 root disk      1,   4 Jan  1  1970 ram4
brw-rw---T  1 root disk      1,   5 Jan  1  1970 ram5
brw-rw---T  1 root disk      1,   6 Jan  1  1970 ram6
brw-rw---T  1 root disk      1,   7 Jan  1  1970 ram7
brw-rw---T  1 root disk      1,   8 Jan  1  1970 ram8
brw-rw---T  1 root disk      1,   9 Jan  1  1970 ram9
crw-rw-rw-  1 root root      1,   8 Jan  1  1970 random
drwxr-xr-x  2 root root          60 Jan  1  1970 raw
crw-r--r-T  1 root root     10,  58 Jul 24 13:35 rfkill
lrwxrwxrwx  1 root root           9 Jul 24 13:35 root -> mmcblk0p2
lrwxrwxrwx  1 root root           8 Jul 24 13:35 shm -> /run/shm
drwxr-xr-x  2 root root         140 Jul 24 13:35 snd
lrwxrwxrwx  1 root root          24 Jul 24 13:35 sndstat -> /proc/asound/oss/sndstat
lrwxrwxrwx  1 root root          15 Jan  1  1970 stderr -> /proc/self/fd/2
lrwxrwxrwx  1 root root          15 Jan  1  1970 stdin -> /proc/self/fd/0
lrwxrwxrwx  1 root root          15 Jan  1  1970 stdout -> /proc/self/fd/1
crw-rw-rw-  1 root root      5,   0 Jan  1  1970 tty
crw-------  1 root root      4,   0 Jan  1  1970 tty0
crw-rw----  1 root tty       4,   1 Jul 24 13:35 tty1
crw-------  1 root root      4,  10 Jan  1  1970 tty10
crw-------  1 root root      4,  11 Jan  1  1970 tty11
crw-------  1 root root      4,  12 Jan  1  1970 tty12
crw-------  1 root root      4,  13 Jan  1  1970 tty13
crw-------  1 root root      4,  14 Jan  1  1970 tty14
crw-------  1 root root      4,  15 Jan  1  1970 tty15
crw-------  1 root root      4,  16 Jan  1  1970 tty16
crw-------  1 root root      4,  17 Jan  1  1970 tty17
crw-------  1 root root      4,  18 Jan  1  1970 tty18
crw-------  1 root root      4,  19 Jan  1  1970 tty19
crw-rw----  1 root tty       4,   2 Jul 24 13:35 tty2
crw-------  1 root root      4,  20 Jan  1  1970 tty20
crw-------  1 root root      4,  21 Jan  1  1970 tty21
crw-------  1 root root      4,  22 Jan  1  1970 tty22
crw-------  1 root root      4,  23 Jan  1  1970 tty23
crw-------  1 root root      4,  24 Jan  1  1970 tty24
crw-------  1 root root      4,  25 Jan  1  1970 tty25
crw-------  1 root root      4,  26 Jan  1  1970 tty26
crw-------  1 root root      4,  27 Jan  1  1970 tty27
crw-------  1 root root      4,  28 Jan  1  1970 tty28
crw-------  1 root root      4,  29 Jan  1  1970 tty29
crw-rw----  1 root tty       4,   3 Jul 24 13:35 tty3
crw-------  1 root root      4,  30 Jan  1  1970 tty30
crw-------  1 root root      4,  31 Jan  1  1970 tty31
crw-------  1 root root      4,  32 Jan  1  1970 tty32
crw-------  1 root root      4,  33 Jan  1  1970 tty33
crw-------  1 root root      4,  34 Jan  1  1970 tty34
crw-------  1 root root      4,  35 Jan  1  1970 tty35
crw-------  1 root root      4,  36 Jan  1  1970 tty36
crw-------  1 root root      4,  37 Jan  1  1970 tty37
crw-------  1 root root      4,  38 Jan  1  1970 tty38
crw-------  1 root root      4,  39 Jan  1  1970 tty39
crw-rw----  1 root tty       4,   4 Jul 24 13:35 tty4
crw-------  1 root root      4,  40 Jan  1  1970 tty40
crw-------  1 root root      4,  41 Jan  1  1970 tty41
crw-------  1 root root      4,  42 Jan  1  1970 tty42
crw-------  1 root root      4,  43 Jan  1  1970 tty43
crw-------  1 root root      4,  44 Jan  1  1970 tty44
crw-------  1 root root      4,  45 Jan  1  1970 tty45
crw-------  1 root root      4,  46 Jan  1  1970 tty46
crw-------  1 root root      4,  47 Jan  1  1970 tty47
crw-------  1 root root      4,  48 Jan  1  1970 tty48
crw-------  1 root root      4,  49 Jan  1  1970 tty49
crw-rw----  1 root tty       4,   5 Jul 24 13:35 tty5
crw-------  1 root root      4,  50 Jan  1  1970 tty50
crw-------  1 root root      4,  51 Jan  1  1970 tty51
crw-------  1 root root      4,  52 Jan  1  1970 tty52
crw-------  1 root root      4,  53 Jan  1  1970 tty53
crw-------  1 root root      4,  54 Jan  1  1970 tty54
crw-------  1 root root      4,  55 Jan  1  1970 tty55
crw-------  1 root root      4,  56 Jan  1  1970 tty56
crw-------  1 root root      4,  57 Jan  1  1970 tty57
crw-------  1 root root      4,  58 Jan  1  1970 tty58
crw-------  1 root root      4,  59 Jan  1  1970 tty59
crw-rw----  1 root tty       4,   6 Jul 24 13:35 tty6
crw-------  1 root root      4,  60 Jan  1  1970 tty60
crw-------  1 root root      4,  61 Jan  1  1970 tty61
crw-------  1 root root      4,  62 Jan  1  1970 tty62
crw-------  1 root root      4,  63 Jan  1  1970 tty63
crw-------  1 root root      4,   7 Jan  1  1970 tty7
crw-------  1 root root      4,   8 Jan  1  1970 tty8
crw-------  1 root root      4,   9 Jan  1  1970 tty9
crw-rw----  1 root tty     204,  64 Jul 24 13:35 ttyAMA0
crw-rw---T  1 root dialout   5,   3 Jan  1  1970 ttyprintk
crw------T  1 root root     10, 223 Jan  1  1970 uinput
crw-rw-rw-  1 root root      1,   9 Jan  1  1970 urandom
drwxr-xr-x  2 root root          60 Jan  1  1970 usb
crw-------  1 root root    251,   0 Jan  1  1970 vc-cma
crw-rw---T  1 root video   250,   0 Jan  1  1970 vchiq
crw-------  1 root root    100,   0 Jan  1  1970 vcio
crw-------  1 root root    253,   0 Jan  1  1970 vc-mem
crw-------  1 root root      7,   0 Jan  1  1970 vcs
crw-------  1 root root      7,   1 Jan  1  1970 vcs1
crw-------  1 root root      7,   2 Jul 24 13:34 vcs2
crw-------  1 root root      7,   3 Jul 24 13:34 vcs3
crw-------  1 root root      7,   4 Jul 24 13:34 vcs4
crw-------  1 root root      7,   5 Jul 24 13:34 vcs5
crw-------  1 root root      7,   6 Jul 24 13:34 vcs6
crw-------  1 root root      7,   7 Jul 24 13:35 vcs7
crw-------  1 root root      7, 128 Jan  1  1970 vcsa
crw-------  1 root root      7, 129 Jan  1  1970 vcsa1
crw-------  1 root root      7, 130 Jul 24 13:34 vcsa2
crw-------  1 root root      7, 131 Jul 24 13:34 vcsa3
crw-------  1 root root      7, 132 Jul 24 13:34 vcsa4
crw-------  1 root root      7, 133 Jul 24 13:34 vcsa5
crw-------  1 root root      7, 134 Jul 24 13:34 vcsa6
crw-------  1 root root      7, 135 Jul 24 13:35 vcsa7
crw-------  1 root root    248,   0 Jan  1  1970 vcsm
crw------T  1 root root     10, 137 Jan  1  1970 vhci
prw-r-----  1 root adm            0 Jul 24 14:54 xconsole
crw-rw-rw-  1 root root      1,   5 Jan  1  1970 zero




I found in /dev/input the touchscreen:

pi@raspberrypi /dev $ cd input
pi@raspberrypi /dev/input $ ls
by-id  by-path  event0  event1  event2  mice  mouse0  mouse1  touchscreen
pi@raspberrypi /dev/input $ cd by-path
pi@raspberrypi /dev/input/by-path $ ls
platform-20204000.spi-platform-stmpe-ts-event
platform-bcm2708_usb-usb-0:1.2:1.0-event-kbd
platform-bcm2708_usb-usb-0:1.2:1.1-event-mouse
platform-bcm2708_usb-usb-0:1.2:1.1-mouse

I’ve tried changing “event-mouse” to “ts-event” but doesn’t works.

Any idea for the next step?
Thanks for the help!

Did you try replacing event-mouse with touchscreen? That seems to be a different relevant device …

Also, in addition to changing event-mouse to touchscreen, try changing /dev/input/by-path/ to /dev/input

If that doesn’t work – I believe you were on the right track changing event-mouse to ts-event. If I were in your situation, I’d probably continue with that change. Then I’d confirm that evtest is giving you events from that device … then I’d go into the readNativeMouseEvents and put some logging / debugging code here:

in order to see what (if any) events are being delivered when you listen to the ts-event.

Hi and thanks again. Entertaining parents from out of town, so a bit scattered ATM. But here’s the /dev/input/ with mouse and keyboard plugged in:

“pi@raspberrypi:~ $ ls -al /dev/input/
total 0
drwxr-xr-x 4 root root 220 Jan 1 1970 .
drwxr-xr-x 13 root root 3340 Jul 16 10:00 …
drwxr-xr-x 2 root root 180 Jan 1 1970 by-id
drwxr-xr-x 2 root root 140 Jan 1 1970 by-path
crw-rw—T 1 root input 13, 64 Jan 1 1970 event0
crw-rw—T 1 root input 13, 65 Jan 1 1970 event1
crw-rw—T 1 root input 13, 66 Jan 1 1970 event2
crw-rw—T 1 root input 13, 0 Jan 1 1970 js0
crw-rw—T 1 root input 13, 63 Jan 1 1970 mice
crw-rw—T 1 root input 13, 32 Jan 1 1970 mouse0
crw-rw—T 1 root input 13, 33 Jan 1 1970 mouse1”

and here’s with them unplugged:

“pi@raspberrypi:~ $ ls -al /dev/input/
total 0
drwxr-xr-x 4 root root 160 Jul 16 10:04 .
drwxr-xr-x 12 root root 3260 Jul 16 10:04 …
drwxr-xr-x 2 root root 80 Jul 16 10:04 by-id
drwxr-xr-x 2 root root 80 Jul 16 10:04 by-path
crw-rw—T 1 root input 13, 66 Jan 1 1970 event2
crw-rw—T 1 root input 13, 0 Jan 1 1970 js0
crw-rw—T 1 root input 13, 63 Jan 1 1970 mice
crw-rw—T 1 root input 13, 33 Jan 1 1970 mouse1”

Will try what you suggest (swapping event-mouse with event2) ASAP, with fingers (and toes) crossed…

Strange things happening this AM that are a bit inconsistent with earlier edits. Will update once I actually understand a little better what’s going on.

Finally i get success!! :grin:

I’ve changed like you have said /dev/input/by-path/ to /dev/input
and replaced “event-mouse” to “touchscreen”

this hasn’t show any change looking at the app window, but in console said:

[notice] ofAppEGLWindow: setupMouse( ) : mouse_fd= 5 devicePath=/dev/input/touchscreen
[notice] ofAppEGLWindow: setupMouse( ) : mouse device name = stmpe-ts

[notice] ofAppEGLWindow: readMouseEvents( ) : unknown mouse axis (perhaps it’s the scroll wheel?)
[notice] ofAppEGLWindow: readMouseEvents( ) : EV_KEY : unknown ev.code =330

And after running ev test I’ve got that:

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 643
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 3541
Min 0
Max 4095
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 255

So the touch events were detected, to see it on the app window I’d to change ofAppEGLWindow.cpp line 1710 BTN_LEFT to BTN_TOUCH and it worked perfectly!! (for now just detect push/release anywhere of the TFT)

I will continue working on it, :wink:

Very grateful with your tips, and thanks again!

####Now push/release and drag events on specific areas also works!

1 Like

This is super exciting news! Once you get a solution working, let’s work to merge it into the oF core. Keep us posted! I found my Adafruit TFT so, I may also be able to test some stuff later next week as well.

Also, perhaps you could post your modified ofAppEGLWindow.h / .cpp file on gist or something so we others can collaborate on getting it all working?

Consider it done :wink:

1 Like