Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi guys ,
i develop a Point of Sale application and i have to use barcode , i searched a lot about using barcode in WPF application and i found that barcode act like keyboard so when i scan a barcode a keydown Event is fired (as a key of keyboard is press) the problem that can not distinguish between keyboard press or barcode press i want to get just the code pressed by barcode and ignore the keyboard press
i found many articles talking about that talking about (Raw input Api) and others says may i deal with time consumed to scan the Code (barcode is faster than the keyboard )i cant treat with (Raw input API) can not understand it , and also the second solution is not acceptable for me (i think it is not logic to make all my operations depend up on the time ) , i found this article talking about the problem
http://nicholas.piasecki.name/blog/2009/02/distinguishing-barcode-scanners-from-the-keyboard-in-winforms/[^]

but did not solve my problem , so any one can put me on the right way
thanks in advanced
Posted
Comments
Sergey Alexandrovich Kryukov 13-Sep-12 23:09pm    
Yes, you are not the first one who asks about this problem. I'm starting to think that the idea to give a barcode scanner a keyboard device interface ("easy" :-) was a lousy idea... :-)
--SA
Yasser El Shazly 13-Sep-12 23:15pm    
how ?
Sergey Alexandrovich Kryukov 13-Sep-12 23:28pm    
How what? How lousy or how to distinguish? :-)
Sorry, I don't know how to distinguish, otherwise I would post an answer. Did you try to look at event parameters and see if you can find a difference?

And by the way, what do you mean by "but did not solve my problem"? What exactly happened? And did you try to ask the author of the article your question? -- always a good idea.
--SA
Yasser El Shazly 13-Sep-12 23:31pm    
i downloaded the source code and tested it nothing happen when i scan a barcode or press button from keyboard
Sergey Alexandrovich Kryukov 14-Sep-12 1:08am    
Not much, I must say. Pressing a button and expecting the result is not enough for getting a thing to work. Did you try to locate the problem under debugger? Again, it would be better if you could address the author of this work.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900