{"id":845,"date":"2013-10-04T23:56:14","date_gmt":"2013-10-04T21:56:14","guid":{"rendered":"http:\/\/www.jensd.de\/wordpress\/?p=845"},"modified":"2013-12-19T12:42:59","modified_gmt":"2013-12-19T11:42:59","slug":"solved-egalax-touch-screen-issues-with-javafx-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.jensd.de\/wordpress\/?p=845","title":{"rendered":"Solved: eGalax Touch Screen issues with JavaFX (on Raspberry Pi)"},"content":{"rendered":"<p>In a <a href=\"http:\/\/www.jensd.de\/wordpress\/?p=516\" title=\"JavaFX 8 embedded currently \u2018untouchable\u2019?\" target=\"_blank\">former post<\/a> I wrote about my trouble getting touch support up an running with my eGalax Touch Display, JavaFX and the Raspberry Pi.<br \/>\nToday Simon gave me a hint how he solved that touch event issues with JavaFX. <\/p>\n<p>Many Kudos to <strong>Simon Ritter<\/strong> (@speakjava)!<\/p>\n<p><strong>The Clue<\/strong><\/p>\n<p>It turns out that the screen driver actually creates <strong>two<\/strong> event devices in <code><strong>\/dev\/input<\/strong><\/code>: <code><strong>event0<\/strong><\/code> and <code><strong>event1<\/strong><\/code>. JavaFX sees <code><strong>\/dev\/input\/event0<\/strong><\/code> and assumes that events come from that, but for some unknown reason no events are actually sent: they all go to <code><strong>\/dev\/input\/event1<\/strong><\/code>.<\/p>\n<p><strong>The Cure<\/strong><\/p>\n<p>Recreate <code><strong>\/dev\/input\/event0<\/strong><\/code> with the same device as <code><strong>\/dev\/input\/event1<\/strong><\/code>, so JavaFX gets the information it needs:<\/p>\n<p><a href=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"850\" data-permalink=\"https:\/\/www.jensd.de\/wordpress\/?attachment_id=850\" data-orig-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1.png\" data-orig-size=\"529,399\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"eGalax_patch1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1-300x226.png\" data-large-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1.png\" tabindex=\"0\" role=\"button\" src=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1.png\" alt=\"eGalax_patch1\" width=\"529\" height=\"399\" class=\"aligncenter size-full wp-image-850\" srcset=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1.png 529w, https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch1-300x226.png 300w\" sizes=\"(max-width: 529px) 100vw, 529px\" \/><\/a><\/p>\n<p><strong>Make it suitability for daily usage<\/strong><\/p>\n<p>Create an init-script to apply the patch at start-up:<br \/>\n&#8216;<code><strong>Required-Start: $all<\/strong><\/code>&#8216; tells <code>insserv<\/code> to start the script after all the other scripts, at the end of the boot sequence:<\/p>\n<p>[bash]<br \/>\n#! \/bin\/sh<br \/>\n### BEGIN INIT INFO<br \/>\n# Provides:          egalax-patch<br \/>\n# Required-Start:    $all<br \/>\n# Required-Stop:<br \/>\n# Default-Start:     2 3 4 5<br \/>\n# Default-Stop:      0 1 6<br \/>\n# Short-Description:<br \/>\n# Description:       Recreates event0 with the same device as event1, so JavaFX gets the information it needs.<br \/>\n### END INIT INFO<\/p>\n<p>. \/lib\/lsb\/init-functions<\/p>\n<p>rm -f \/dev\/input\/event0<br \/>\nmknod \/dev\/input\/event0 c 13 65<\/p>\n<p>log_success_msg &#8220;eGalax Touch Screen patch for JavaFX applied.&#8221;<br \/>\n[\/bash]<\/p>\n<p>You can load it <a href=\"http:\/\/www.jensd.de\/apps\/scripts\/egalax-patch\">here<\/a>.<\/p>\n<ul>\n<li>copy the script to <code><strong>\/etc\/init.d\/<\/strong><\/code><\/li>\n<li>make sure it&#8217;s executable: <code><strong>sudo chmod 755 egalax_patch<\/strong><\/code><\/li>\n<li>then enable the script: <code><strong>sudo insserv egalax-patch<\/strong><\/code><\/li>\n<\/ul>\n<p><strong>One last thing<\/strong><\/p>\n<p>The event devices are re-created by the driver when the USB connection was interrupted.<br \/>\nIn this case you will have to reboot the Raspi or (much better) execute the script manually:<\/p>\n<p><a href=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"859\" data-permalink=\"https:\/\/www.jensd.de\/wordpress\/?attachment_id=859\" data-orig-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2.png\" data-orig-size=\"558,159\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"eGalax_patch2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2-300x85.png\" data-large-file=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2.png\" tabindex=\"0\" role=\"button\" src=\"http:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2.png\" alt=\"eGalax_patch2\" width=\"558\" height=\"159\" class=\"aligncenter size-full wp-image-859\" srcset=\"https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2.png 558w, https:\/\/www.jensd.de\/wordpress\/wp-content\/uploads\/2013\/10\/eGalax_patch2-300x85.png 300w\" sizes=\"(max-width: 558px) 100vw, 558px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip; <span class=\"clear\"><\/span><a href=\"https:\/\/www.jensd.de\/wordpress\/?p=845\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">Solved: eGalax Touch Screen issues with JavaFX (on Raspberry Pi)<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"Solved: eGalax Touch Screen issues with #JavaFX (on #RaspberryPi) http:\/\/wp.me\/p38FCL-dD","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[30,4,18,23],"tags":[29,91,76,86,28],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p38FCL-dD","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/845"}],"collection":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=845"}],"version-history":[{"count":23,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/845\/revisions"}],"predecessor-version":[{"id":2081,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/845\/revisions\/2081"}],"wp:attachment":[{"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jensd.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}