kabla
Posts: 6
Joined: Fri Feb 14, 2014 3:17 pm

SDL2 touch event handling

Thu May 08, 2014 4:20 pm

Hello!

I have a touch screen by Chalkboard Electronics (this one: http://www.chalk-elec.com/?page_id=1280 ... d=14647624). I'm having some troubles getting touch events to work in SDL2.

I'd prefer to have the touch screen working without loading up X-Windows. I've tried using SDL_FINGERMOTION/SDL_FINGERDOWN, but to no avail. Mouse events are handled perfectly, but the touch screen doesn't trigger these.

Could someone please point me in the right direction? I'll gladly supply some more information if needed.

ratwix
Posts: 12
Joined: Wed Sep 12, 2012 12:21 pm

Re: SDL2 touch event handling

Sat Jul 12, 2014 10:20 am

Hello, do you find any solution ?

I also need to catch touch event (or mouse event) from SDL2 without using X (due to opengl es)
I also have a screen from Chalkboard Electronics. Which driver do you use ?

From my side, I am not able to get mouse event as well. How do you trigger them ? Is it work without X ?

Thank for your help.
Charles

jum
Posts: 19
Joined: Wed Mar 20, 2013 12:18 pm

Re: SDL2 touch event handling

Tue Dec 13, 2016 9:40 am

I am also trying to get touch events working in SDL2 on RPi (with offical 7" touch screen), without success (SDL_FINGERDOWN events are not detected).

Perhaps this is not supported in the version of SDL2 on the RPi. I notice there are touch functions in SDL2.0.4 that are missing from my SDL2 installation on RPi (eg: SDL_TouchInit()). (Maybe I need to include SDL_touch.h or something).

As a fallback it is possible to use /dev/input/eventN to read touch events.

Return to “C/C++”