Windows form, Key Press event, C#
// this is the software, where I detect SOF and EOT
private void RxPurchaseOrder_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
if ((e.KeyChar == AcdStart.ScannerSot) && (ScannerStarted == false))// SOH, I am using “{” as SOT u0001 creates more problems
{
ScannerMessages = “”;
e.Handled = true;
timer1.Interval = 1000;
timer1.Start();
ScannerStarted = true;
}
else
{
if (ScannerStarted == true)
{
if (e.KeyChar != AcdStart.ScannerEot)// EOT “CR”
{
ScannerMessages += (e.KeyChar);
}
else
{
ScannerStarted = false;
timer1.Stop();