Getting Barcode Scanner MT2000 to Move to Next Focus

290 views Asked by At

I am trying to move to the next focus of an application by transmit a TAB or ENTER character to the host from my Motorola MT2070 Barcode Scanner.

I have tried using the SendLabel method as follows

       string barcode = "Hello";
       int count = 1;

        SendBarcode(new LabelData(barcode + "\t" + count.ToString(), Options.BarcodeType));
        count++;
    }

    private bool SendBarcode(LabelData label)
        {
        RESULTCODE result = RESULTCODE.E_OK;
        try
        {
            result = Program.ScannerServicesClient.SendLabel(label, 10000);
        }
        catch
        {
            result = RESULTCODE.E_HOST_NOT_READY;
        }
        if (result != RESULTCODE.E_OK)
        {
            MsgBox.Error(listForm, Properties.Resources.StrErrorCouldntSendBarcode);
        }
        return result == RESULTCODE.E_OK;
    }

Unfortunately the "\t" does not translate into an actual TAB keystroke in Keyboard mode.

When scanning in NOTEPAD the 5 spaces of the tab show up, but it doesn't work to move the focus to the next field as hitting TAB does in Excel or other applications.

What should I be transmitting in place of the \t?

Thanks!

1

There are 1 answers

3
etalon11 On

I assume this won't work, because it is not a normal/manual input from your keyboard. It is a value passed from a barcode to the text-property of your field. So you have to handle this different.