Prevent keyboard input but allow automatic scanner input on textbox

房东的猫 提交于 2019-12-12 04:33:24

问题


Hello everyone I'm using a RFID scanner that puts the scanned code in whatever text field available at scanning time. For instance, it could put the text inside a cell in Excel or in the address bar of a web browser.

I made an application with a textbox that receives the input sent by the scanner, but I want to disable user-input (keyboard). I tried setting the textbox property "read only" to true, but then the text is not displayed in the textbox.

How can I do that? Thanks in advance :)


回答1:


Most barcode scanners are just keyboard input. This would could be done via intercepting HID calls or intercepting key press events in the input box. I wouldn't expect that to work well, but good luck.



来源:https://stackoverflow.com/questions/12482312/prevent-keyboard-input-but-allow-automatic-scanner-input-on-textbox

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!