How to Check if User input is from Barcode Scanner or Keyboard?

Crimsonland picture Crimsonland · Feb 23, 2011 · Viewed 34.3k times · Source

I am creating a p.o.s application for a cafeteria company in which the cashier scans his employee ID and it shows his information for the transaction.

My Problem is, the cashier can also use their keyboard for their input (employee ID) which is very risky.

if employee(true)
   show employee information
   then add orders
else
   Exception

Currently I just hide TexTbox from the UI, click New Button then set cursor focus on it. Then cashier scans employee id. In this part, the cashier can also type via keyboard and continue transaction.

What is the best way to handle this scenario? The rule is only barcode scanner must be use.

Thanks in regards

Answer

user105304 picture user105304 · Feb 23, 2011

You could monitor the time it took for the code to be entered. A reader would enter the code much faster than a human typing it in.