如何检查,如果用户输入来自条码扫描器或键盘? [英] How to Check if User input is from Barcode Scanner or Keyboard?

查看:422
本文介绍了如何检查,如果用户输入来自条码扫描器或键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在创造了公司食堂POS应用程序,
收银员扫描员工ID,并显示其对自己的交易信息。

I am now creating p.o.s application for company cafeteria which the cashier scan employee id and show its information for their transaction.

我的问题是出纳还可以用自己的键盘为他们输入(雇员),这是非常危险的。

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

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

Currently i just hide textbox to the UI..
click New Button then cusror focus on it. 
then cashier scans employeeid.  <---------------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.

谢谢问候

推荐答案

您可以监视它了要输入代码的时间。一位读者将输入代码比人类打字快了很多。

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.

这篇关于如何检查,如果用户输入来自条码扫描器或键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆