| Author |
detect device from which input is provided
|
Preston Taylor
Greenhorn
Joined: Feb 18, 2010
Posts: 7
|
|
|
I am writing a program that needs to accept input from a bar code scanner, which is really not the issue since most scanners are just a keyboard, but because I can't trust the users to input non-falsified information I need certain text boxes to accept input from the scanner and the scanner only. how do I determine from what device text input is coming from?
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16479
|
|
|
If the operating system makes them look exactly like the keyboard, you don't have any hope of figuring out what hardware your keyboard inputs are coming from. (Or at least not much hope... scanning a barcode might send keystrokes faster than a human can, and you might be able to discern that with a KeyListener or something.) But I'd say your best approach would be, since it's an operating-system or hardware issue, to solve the problem at the operating-system or the hardware level.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Paul Clapham wrote:scanning a barcode might send keystrokes faster than a human can, and you might be able to discern that with a KeyListener or something.
One word: macros. I have already programmed my keyboard to use a few, so with one press on my keyboard I can post entire pieces of text.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: detect device from which input is provided
|
|
|