The latest OpenJFX sources in the 8u-dev repository provide touch screen coordinate transforms for embedded Linux devices. This allows the coordinate space of a touch screen to be scaled, translated and flipped. In order to set the transforms for a screen it is first necessary to find out the product ID of the touch screen device. The product ID is a list of four hexadecimal numbers, separated by forward slashes. The numbers are:
- Bus ID
- Vendor ID
- Product ID
- Version ID
The easiest way to find out these numbers for a device is usually to run the following command on the target device:
cat /proc/bus/input/devices
and then look for a line starting with the characters "I: Bus="
that matches the touch screen. The other way to find out these numbers is to run the the GetEvent
class using OpenJFX:
sudo java com.sun.glass.ui.monocle.GetEvent
This queries the configuration of all input devices used by JavaFX.
Once you have the touch screen's product ID, you can set the following properties for it:
Property | Type | Function |
---|---|---|
minX | int | the X value returned by the touch driver on the extreme left of the display |
maxX | int | the X value returned by the touch driver on the extreme right of the display |
minY | int | the Y value returned by the touch driver on the extreme top of the display |
maxY | int | the Y value returned by the touch driver on the extreme bottom of the display |
flipXY | boolean | the X and Y axes are swapped if this property is true |
Each touch property is set using the system property setting
monocle.input.<product ID>.<property>=<value>
See https://javafx-jira.kenai.com/browse/RT-35300