I want to change a virtual key after keystroke, I used raw inputs to get device information.
Actually I have two keyboards (a keyboard and a barcode scanner) and with raw input I can get that the keystroke come from with one, but I need to change virtual keys if they come from barcode scanner. Change them to "KeyChar = Convert.ToChar(0);"
Is that possible, then how?
I'm not sure what you're asking or the exact environment you're in, but I've been working with barcode scanners using Winforms, and I had the requirement to first fetch the scanned text, change something about it, then send it on to the form. Capturing key strokes is easy, but how are you gonna know if they come from the barcode scanner or the keyboard?
The trick I used is in the barcode format. They usually have a start and stop sign, something like $. Use your scanner and scan something into Notepad and you'll see.
Then use this sign as a way of start capturing key strokes. So for each $ you start capture every following keystroke made, then at the next $ you stop capture, take that string and do whatever you want with it. Shot the result back to the form using SendKeys (assuming you have at least removed the start/stop sign).
Note, this only works with the code-xxx bar codes. For the GTIN standards, they often don't use a start or stop sign so they are a little more tricky.