• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

detect device from which input is provided

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Marshal
Posts: 27450
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 22700
129
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
knowledge is the difference between drudgery and strategic action -- tiny ad
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic