0

I have an embedded application which is using x11 with opengl for windowing and rendering of graphics. The device has a touch screen, which is used for application interaction. Currently, the touch screen driver is implemented in our application space and we handle the events accordingly. However, I want that the touch events should go to the application via X11 interface.

Can anyone help me understand how this can be achieved ?

Monku
  • 2,440
  • 4
  • 33
  • 57
  • Probably the simplest way is to take some touchscreen kernel driver that is known to work with X11 and modify it to work with your hardware. – n. m. could be an AI Dec 26 '14 at 13:25
  • I am not getting you completely. Do you mean that I need X11 driver ? I am new to linux drivers and X11. Can you please explain what you meant ? – Monku Dec 31 '14 at 00:37
  • I mean you need a kernel driver. An X11 input driver is another option. A kernel driver talks to hardware and presents it to the world as a special file. An X11 input driver hooks to a source of events (normally a special file above, but could be anything) and presents it to the X server as an input device. You can work at the kernel level (look at touchscreen kernel driver sources for inspiration) or at the X11 level (look at X11 input driver sources such as evdev). – n. m. could be an AI Dec 31 '14 at 06:17
  • thanks. I am looking into an example X11 touchscreen driver called "evtouch". It should give some idea as to what I need to know about creating x driver for my touchscreen device. – Monku Jan 03 '15 at 19:32
  • I guess Yes you can. see https://wiki.maemo.org/Using_touch_screen_pressure_data – EsmaeelE Jul 09 '17 at 00:21

1 Answers1

1

Probably the easiest way is the uinput module. This allows you to create a "virtual device" in userspace that can generate events. Those can be caught with the evdev driver by the xserver and sent to your application (o any other window). See linux uinput: simple example?

Sam Hartman
  • 6,210
  • 3
  • 23
  • 40
Manuel
  • 11
  • 1