Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can my VB App differentiate between input from a barcode vs. keybd? 1

Status
Not open for further replies.

MiniMe2

Programmer
May 19, 2002
15
US
I'm building a Visual Basic application that will use both the keyboard and a barcode scanner for user input. Is there a way that my application can discern which input device was used? I would like for the application to know which input device was used after each entry. Thanks, MiniMe2','I''m building a Visual Basic application that will use both the keyboard and a barcode scanner for user input. Is there a way that my application can discern which input device was used? I would like for the application to know which input device was used after each entry.


Thanks
 
My experience is with keyboard-wedge scanners, where the scanner plugs into the keyboard socket on the cpu, and the keyboard plugs in 'behind' the scanner. In such a case, as far as I know, the data arrives from the scanner as if it was from the keyboard.

But if you used a scanner on the serial port, I dsaresay you could distinguis because you would be using a comms mechanism to read the scanner and would know what came from what. I think! Jim Brown,
Johannesburg,
South Africa.
My time is GMT+2
 
Thanks Jim!

I'm afraid that this is what I expected.
 


get the user to press a key for manual input
then you know it was typed


 
If your keyboard wedge scanner is programmable, most are. Then you could add a character to the end or beginning. Called “adding a Suffix” or Prefix. This of course is only sent when the barcode scanner is used. Then your app could look for that character and you would know if it came from the scanner or not.

For a prefix
MySpecialCharater = “|” ‘use a pipe or Caret “^” “~” or tilde something
If Left(mydata,1)= MySpecialCharater then
‘Strip it off
myData2= right(mydata,len(mydata) –1)
End if

For a suffix
MySpecialCharater = “|”
If right(mydata,1) = MySpecialCharater then
‘Strip it off
myData2= left(mydata,len(mydata) –1)
End if
DougP, MCP
 
Thanks so much for all of your replies! I will try adding the extra character.


Best Regards,

MiniMe2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top