条形码阅读器的原始输入 [英] Raw Input for Barcode Reader

查看:83
本文介绍了条形码阅读器的原始输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您的使用来自C#的原始输入来处理多个键盘"的文章非常出色,谢谢:),但是我想为条形码读取器执行此操作,但是我在匹配字符方面遇到问题,这与您如何处理有关可以帮助我吗?

Your "Using Raw Input from C# to handle multiple keyboards" article is excelent thank you very much :) but I want to do this for barcode reader, but I''m having problems in matching the characters can handle regarding how you can help me?

推荐答案

不要在快速解答"下发布该帖子-如果您从文章中获得了代码,则在此处有一个新消息"按钮该文章的底部,这将导致向作者发送电子邮件.然后会通知他们您希望与他们交谈.
将其发布到这里依赖于他们的下落"并意识到它是为他们而设计的.
Don''t post this under Quick Answers - if you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.


我已经成功完成了您在这里寻找的东西.我有一个可以从Honeywell/Metrologic条形码扫描仪接收所有条形码字符数据的应用程序.系统上没有其他应用程序从扫描仪接收数据,并且键盘继续正常运行.

我的应用程序结合了原始输入和可怕的低级键盘挂钩系统.与我在许多在线资源中读到的内容相反,我发现在调用键盘挂钩函数之前已收到wm_input原始输入消息.我处理wm_input消息的代码基本上设置了一个布尔变量,以指定接收的字符是否来自扫描程序.处理完wm_input后立即调用的键盘挂钩函数吞下了扫描仪的伪键盘数据,从而阻止了其他应用程序接收该数据.

键盘挂钩功能必须放置在dll中,因为您想拦截所有系统键盘消息.另外,必须将内存映射文件用于wm_input处理代码才能与dll通信.
I have successfully accomplished what you are looking for here. I have an application that receives all barcode character data from a Honeywell/Metrologic barcode scanner. No other application on the system receives the data from the scanner, and the keyboard continues to function normally.

My application uses a combination of raw input and the dreaded low-level keyboard hook system. Contrary to what I''ve read in numerous online resources, I found that the wm_input raw input message is received before the keyboard hook function is called. My code to process the wm_input message basically sets a boolean variable to specify whether or not the received character is from the scanner. The keyboard hook function, called immediately after the wm_input is processed, swallows the scanner’s pseudo-keyboard data, preventing the data from being received by other applications.

The keyboard hook function has to be placed in an dll since you want to intercept all system keyboard messages. Also, a memory mapped file has to be used for the wm_input processing code to communicate with the dll.


这篇关于条形码阅读器的原始输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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