Domanda

I have an application written on Java running on the machine (Linux/Windows). I want to make this application run like a background application so that it does not interrupt while using other applications in the system. Now I want to popup a screen and show some buttons (to do some tasks based on the selection) when a QR Code is scanned using a scanned attached to the USB port. When this scanning happens my Java application that initiates the popup screen is running in the system tray.

--Edit--
I have used key listeners to identify the bar code scanning and pull out information from database based on what is scanned. But while scanning my application, was open. So I attached the action listeners in the AWT level so that the key strokes/scanning is caught and taken care off. But now in the current case I wont be having any windows active. SO I NEED TO CAPTURE THE SCANNED INPUT INTERNALLY WHEN THE APPLICATION IS MINIMIZED IN THE SYSTEM TRAY.

È stato utile?

Soluzione

I think the only avenue open to you is capturing system-wide keyboard events. There is a library that handles that for Java: jnativehook. But how you're going to detect which events are coming specifically from your HID device, I'm not sure.

There is also the JavaHIDAPI, an amateur-level project whose "hello, world" test example failed with IOException on my machine. The good part is, all the code is there, including the native C for Windows.

Finally, I found this, a very good tutorial on how to talk to HID's on Windows.

Altri suggerimenti

You can see if Headless Mode works or start up VNC on your host.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top