Solved: eGalax Touch Screen issues with JavaFX (on Raspberry Pi)

In a former post I wrote about my trouble getting touch support up an running with my eGalax Touch Display, JavaFX and the Raspberry Pi.
Today Simon gave me a hint how he solved that touch event issues with JavaFX.

Many Kudos to Simon Ritter (@speakjava)!

The Clue

It turns out that the screen driver actually creates two event devices in /dev/input: event0 and event1. JavaFX sees /dev/input/event0 and assumes that events come from that, but for some unknown reason no events are actually sent: they all go to /dev/input/event1.

The Cure

Recreate /dev/input/event0 with the same device as /dev/input/event1, so JavaFX gets the information it needs:

eGalax_patch1

Make it suitability for daily usage

Create an init-script to apply the patch at start-up:
Required-Start: $all‘ tells insserv to start the script after all the other scripts, at the end of the boot sequence:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          egalax-patch
# Required-Start:    $all
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description:
# Description:       Recreates event0 with the same device as event1, so JavaFX gets the information it needs.
### END INIT INFO

. /lib/lsb/init-functions

rm -f /dev/input/event0
mknod /dev/input/event0 c 13 65

log_success_msg "eGalax Touch Screen patch for JavaFX applied."

You can load it here.

  • copy the script to /etc/init.d/
  • make sure it’s executable: sudo chmod 755 egalax_patch
  • then enable the script: sudo insserv egalax-patch

One last thing

The event devices are re-created by the driver when the USB connection was interrupted.
In this case you will have to reboot the Raspi or (much better) execute the script manually:

eGalax_patch2

8 Replies to “Solved: eGalax Touch Screen issues with JavaFX (on Raspberry Pi)”

  1. Karl TroutMarch 12, 2014 at 00:34Reply

    did you have any issues with JavaFX 2.2, JDK 1.8.0-ea build 123 and inverted x&y on your touchscreen? I have mine working fine in X11 but my javafx apps have no luck and I can not find a seeting that affects it.

    1. Jens DetersMarch 12, 2014 at 13:27Reply

      You are running your JavaFX apps directly in the Framebuffer? An you have this inverted issues either with JavaFX 2.2 and JavaFX 8?

      1. karl troutMarch 12, 2014 at 14:04Reply

        yea, the JAVA FX app is running directly in the FrameBuffer no X manager involved. also, my /dev/input/event* is coming in on event2 and it is getting picked up correctly by my app and the system as an HID. interesting thing is I had to set evdev to invertY and invertX as well as swapXY in the 10-evdev.conf file to get it to work in X but being that JavaFX is running in its own fb it seems to bypass this configuration and go straight to the device. I am running the latest JDK 8 from oracle as well as the latest FX (I thought 2.2)

        1. Sergio SoaresMay 7, 2014 at 03:29Reply

          I have your exactly same problem, Karl!

          Did you manage to solve it?
          Please let me know if you found out how to solve it.
          My email is: eng.sergiosoares@gmail.com

          Thanks,

          Sergio.

  2. Nicolás RodríguezJune 11, 2014 at 05:55Reply

    Exactly the same problem…
    please let me know if someone have solve it

    my email: rodriguezmuller@gmail.com

    tanks a lot…

    Nico

    1. csgo strongApril 20, 2017 at 20:40Reply

      peanut butter but always thought that it took some kind of special grinder. Thankfully Stacy over at Delighting In The Days  posted a recipe for homemade peanut butter made in a food processor. I don’t have a food

Leave a Comment