Barcode InfoPCL FontsHome


Can a Keyboard Function Key be Embedded in a Barcode?
Home > Barcode Basics > Application Notes > AppNote016

There are times when embedding a function key in a barcode would really help efficiency. Some application programs use F5, F10, or some other function key to initiate Next Page or Save Transaction functions; with a function key embedded in a barcode, the action could be initiated automatically, saving operator keystrokes and time.

Some types of barcodes (Code 128, for example) can encode standard ASCII control codes, including Carriage Return, Line Feed, Horizontal Tab, Vertical Tab, etc. But they cannot encode keyboard function keys. The reason is that function keys (F1, F5, etc.) are particular to the hardware; in the case of standard desktop PC's they are transmitted as keyboard scan codes. There are no equivalent ASCII control codes that can be contained in a barcode.

There is a way around this limitation. Many keyboard wedge scanners include an option for substituting characters; whenever a specified character is read from a barcode, it will be replaced by a different character. Since scanners with keyboard wedge interfaces use the same data transmission standards as a keyboard, they can send a scan code representing a function key. For example, if the application will never need a dollar sign ($) in the barcode, the scanner could be programmed to replace dollar signs with F5 keys; scanning a barcode containing 12345$ would produce the same result as typing 12345 followed by the F5 key.

Note that this works only with keyboard wedge scanners. Barcode scanners attached to a serial port are restricted to the standard ASCII code chart, so no special keyboard function keys.


(c) Copyright Measurement Equipment Corporation
All Rights Reserved