Touchscreen calibration for Raspberry Pi in JavaFX is not working

950 views Asked by At

I am using:

  1. Raspberry Pi Model B (Rev 1.0, 256Mb); cat /proc/cpuinfo returns for Revision 0002,
  2. Raspbian Jessie with PIXEL (Version: November 2016, Release date: 2016-11-25, Kernel version: 4.4),
  3. Java is preinstalled with Raspbian Jessie (java -version returns java version "1.8.0_65"),
  4. JavaFX is by Gluon (JavaFX Embedded SDK 8.60.8),
  5. Touchscreen is WAVESHARE 4inch Resistive Touch Screen LCD, HDMI interface, IPS Screen, Designed for Raspberry Pi, link: http://www.waveshare.com/wiki/4inch_HDMI_LCD,
  6. Driver for touchscreen is installed by instructions on link in step 5.,
  7. Touchscreen calibration for JavaFX application is by instructions: https://wiki.openjdk.java.net/display/OpenJFX/Touch+screen+calibration+on+embedded+platforms

Important notes:

  1. Orientation for my touchscreen is set in /boot/config.txt as display_rotate=3 (270 degrees - landscape),
  2. I tryed different combinations for minX, maxX, minY, maxY, flipXY and nothing helped me,
  3. My JavaFX application is simple test application, where only one button is in center: https://i.stack.imgur.com/Q3R02.jpg
  4. Top Left corner should have coordinates 0, 0 (corner at LAN conector), and Bottom Right corner should have coordinates 800, 480, axis x should be horizontal, axis y should be vertical,
  5. My problem is that y axis is horizontal (range 0 - 479) and x axis is vertical (range 0 - 799) and flipXY don't work!
  6. Touch on button in center of touchscreen not generate touch event along the length of button!

Note: swapxy=1 in /boot/config.txt don't work also!

Please, help me.

1

There are 1 answers

0
graynk On

It's an old question, but for me the following combination of JVM parameters works:

-Dmonocle.input.0/0/0/0.minX=0
-Dmonocle.input.0/0/0/0.maxX=480
-Dmonocle.input.0/0/0/0.minY=480
-Dmonocle.input.0/0/0/0.maxY=-320
-Dmonocle.input.0/0/0/0.flipXY=true

In config.txt I specified only display_rotate=3