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

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

问题描述

我正在为一家自助餐厅公司创建一个 p.o.s 应用程序,其中收银员扫描他的员工 ID 并显示他的交易信息.

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.

我的问题是,收银员也可以使用键盘输入(员工 ID),这是非常危险的.

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

目前我只是从 UI 中隐藏 TexTbox,单击 New Button 然后将光标焦点设置在它上面.然后收银员扫描员工 ID.在这部分,收银员也可以通过键盘输入并继续交易.

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.

谢谢你的问候

推荐答案

您可以监控输入代码所用的时间.阅读器输入代码的速度比人工输入代码快得多.

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天全站免登陆