To All,
I’ve written a program which takes the input from a barcode scanner and sends it as a keyboard wedge to any textbox that has focus.
I’m using keybd_event() to send the characters, and the program works well, unless I have duplicate characters in my character array. For example:
FQT-123 in my array displays just fine in the textbox. However,
FQT-100 will display as “FQT-10”
Or “Q6335-10009” will be read out as: “Q6334-1009” or sometimes as “Q634-109”
I’ve tried to remedy this by throttling the FOR loop that iterates through the character array with a sleep(50)
for (uiLoop=0; uiLoop<uiCount; uiLoop++)
{
Sleep(50);
keybd_event(bOutput[uiLoop], 0, KEYEVENTF_SILENT, 0);
}
This works, but it seems like it causes my handheld to lock up. Sometimes it doesn’t print any of the charcters at all except for the newline.
Does anyone have any suggestions for preventing the dropping of those repeated characters
Ryan

keybd_event() drops duplicate characters
Ariston Darmayuda
Actually,
I just figured out the answer before I logged back on, but KEYEVENTF_KEYUP was the key.
keybd_event(bOutput[uiLoop], 0, KEYEVENTF_KEYUP | KEYEVENTF_SILENT, 0);
Ryan
Chris Lovett
Hi,
didn't find information on KEYEVENTF_SILENT, but KEYEVENTF_KEYUP sounds promising. If SendInput is also available for Smart Device development that might also be an alternative guaranteeing uninterupted sequences of characters.
--
SvenC