Im trying to build a program to read a magnetic card from a cardreader simulated as a keyboard. However for the time being every char is its own event and its taking around 1.100milisec to 1.3milisec to read the card, this is abit to high. The complete cycle is around 1500 milisec and what we are aiming for with this application is around 600-700 milsec.
I was wondering if there was any way to get a string in faster then with keydown events. Or perhaps a way to speed them up.
void _keyboard_KeyDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
{
if (args.KeyAscii == ';' || args.KeyAscii == '%')
{
Card = null;
record = true;
}
else if (args.KeyAscii == '?')
{
record = false;
Send();
Card = null;
}
else
{
if (record == true)
{
Card += args.KeyAscii;
}
}
}
The send function is just to communicate with the server to get a response on the cards.