SDL2 touch events in Raspbian / console mode

I’m trying to get touch events to work in Raspbian without using XWindows, and the touch screen I am using is this one:

http://www.chalk-elec.com/?page_id=1280#!/~/product/category=3094861&id=14647624

The touchscreen works perfectly in XWindows right away, but I can?t get things working in SDL2, when I?m starting my C++ program from the console.

I have compiled SDL2 using the following:

sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
wget https://www.dropbox.com/s/mpai8q1hpoju9xz/SDL2_install.sh (a script for compiling it)
sh ./SDL2_install.sh
[2] download, compile and install source files

Mouse and keyboard events work perfectly, but I am not getting any events when I?m doing SDL_PollEvent while interacting with the screen.

The following shows me that the screen should be sending something (I get some random gibberish on the screen):

cat /dev/input/event4 (can be event1 also, apparently, it might change after rebooting)

I?m at a loss as to what I should be looking into. Any help as to what direction I should take to get this working is deeply appreciated.

There’s a recent thread where I mentioned a couple of utilities you can use
to debug udev/evdev issues. If the device presents itself as a mouse and it
sends mouse events (relative or absolute), it should work with SDL.

2014-07-07 6:34 GMT-03:00 kabla :> I’m trying to get touch events to work in Raspbian without using

XWindows, and the touch screen I am using is this one:

http://www.chalk-elec.com/?page_id=1280#
!/~/product/category=3094861&id=14647624

The touchscreen works perfectly in XWindows right away, but I can?t get
things working in SDL2, when I?m starting my C++ program from the console.

I have compiled SDL2 using the following:

sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
sudo apt-get install libraspberrypi0 libraspberrypi-bin
libraspberrypi-dev
wget https://www.dropbox.com/s/mpai8q1hpoju9xz/SDL2_install.sh (a
script for compiling it)
sh ./SDL2_install.sh
[2] download, compile and install source files

Mouse and keyboard events work perfectly, but I am not getting any events
when I?m doing SDL_PollEvent while interacting with the screen.

The following shows me that the screen should be sending something (I get
some random gibberish on the screen):

cat /dev/input/event4 (can be event1 also, apparently, it might change
after rebooting)

I?m at a loss as to what I should be looking into. Any help as to what
direction I should take to get this working is deeply appreciated.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.