I have designed a standalone application using swings which can read data from HID device using HID events. I am asked to implement same on a website. How can I handle HID events on a h:inputText box in JSF. Is this possible? If not, what are the possible alternatives?
I have designed a standalone application using swings which can read data from HID
Share
Well, you’d need to create a signed Java Applet or Java Web Start (JNLP) Application (which can use the same code as you used in the Swing application). This allows you to execute Java (Swing) code in the client side. Finally you can embed this applet or JNLP application in your JSF page the usual way. You can interact between the applet or JNLP application and the JSF-generated HTML page using the JavaScript API.
There is in JavaScript no standard way to capture events from an arbitrary device other than keyboard and mouse. As JSF is basically just a HTML/CSS/JS code generator, it can’t do any much for you here.