2

I need to create a system which in background can listen to all data inputs from a MSR (Magnetic Strip Reader).

I have a GUI in my program but I don't have the focus on it because another program simultaneously need to get the same data from the MSR.

There is no possibility to have the users creep two time the card, and neither to change the focus from one program to another.

The only workaround is to listen in background for all the inputs I think.

  • How can I do that?
  • There are already classes for that?
  • There is a way to specifically listen only for MSR inputs?

Thanks!

rpasianotto
  • 1,383
  • 1
  • 9
  • 22
  • Possible duplicate of [Java key listener to track all keystrokes](http://stackoverflow.com/questions/12177416/java-key-listener-to-track-all-keystrokes) – Longhup Dec 11 '15 at 08:42
  • Do you know how to identify exactly only the inputs from MSR? – rpasianotto Dec 11 '15 at 14:49
  • I think that, if the MSR is just a UBS device, it is not trivial to determine which device genereted the key events. Maybe you need to have some sort of "driver" for the MSR. – Longhup Dec 14 '15 at 09:33
  • [Alvaro Sanchez Martinez](https://stackoverflow.com/users/13094502/alvaro-sanchez-martinez) left this link to [javaQuery](https://www.javaquery.com/2014/05/how-to-create-key-logger-in-java.html) about how to capture any input with Java while running in the background. – Scratte Mar 25 '20 at 20:46
  • You can check my [lightweight library](https://github.com/Animeshz/keyboard-mouse-kt) for keyboard event listening and such purpose, check [the docs](https://animeshz.github.io/keyboard-mouse-kt/) for more info. Yet I haven't implement anything such to access the type of device or its id, but may implement if you request. – Animesh Sahu Jan 10 '21 at 17:28

0 Answers0