Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: WPF C#4.0 VS2010
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 13-Sep-12 17:53pm
Comments
Sergey Alexandrovich Kryukov at 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
yayaNasr at 13-Sep-12 23:15pm
   
how ?
Sergey Alexandrovich Kryukov at 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
yayaNasr at 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 at 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)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 13 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100