Keystroke Output

DataWedge 6.7

Overview

Keystroke Output collects the processed data and sends it to the associated application as a series of keystrokes, emulating the actions of a user pressing keys on the device. DataWedge supports TAB, ENTER and other special characters that might be required by an application to submit acquired data for further processing, to advance the cursor to another input field or for other reasons. Special characters are added to acquired data by using the Action key character (shown below) and in the Basic Data Formatting or Advanced Data Formatting Process functions.

The parameters of this feature can be configured using the Set Config API.


Outputting Raw Data

In addition to its normal plain-text and hexadecimal modes, DataWedge can output acquired data in its raw form, before the application of any encoders. This can be useful if custom encoders are needed for acquiring character sets not supported by Zebra.

Raw data is received as a byte stream using the com.symbol.datawedge.decode_data intent extra. For more information, see the Intent Output guide.

Raw data cannot be output as keystrokes.


Keystroke Output Setup

To enable Keystroke output for a Profile, place a check in the checkbox: Keystroke Output options

Action key character - enables injection of a special character embedded within barcode or MSR data. Possible values:

  • None - inject no action key
  • Tab - inject action key in place of a ASCII Tab (0x09) character
  • Line feed - inject action key in place of ASCII LF (0x0A) character
  • Carriage return - inject action key in place of ASCII CR (0x0D) character

Inter-character delay – used to set a delay (in ms) following the delivery of each character to the application. This parameter is intended to help avoid issues that arise when data is dispatched too quickly for an application to accept. Default=0. If experiencing errors in keystroke delivery, increase this value in increments of 100 (to a max. of 1000) until errors cease. Note: This parameter can negatively effect application performance.

Multi-byte character delay - applies the Inter-character delay (described above) to multi-byte characters only. This parameter is intended to help avoid problems that arise when sending Unicode and multi-byte characters to the Android browser. Available only when Inter-character delay is enabled. Disabled by default.

Key event delay - used to set a delay (in ms) for dispatching control characters as keystrokes to the foreground application.


Profile Import Behavior

  • For Profiles imported into DataWedge 6.7 from prior versions, the value specified for the "Multi byte character delay" is applied to the Inter-character delay and the “Delay Multi-byte characters only” parameter is enabled.

  • For Profiles created with DataWedge 6.7 and imported into a prior version, the specified delay, if any, is applied only to multi-byte characters.


UDI Data Output

This setting applies when the Scanning mode in Barcode Reader Params is set to UDI, which acquires multiple data points (tokens) as specified in the Universal Device Identifier parameter(s) selected in the above-referenced section.

Token selection - allows the output order of acquired UDI data to be adjusted and the optional insertion of a Tab, Line Feed or Carriage Return character between tokens, if required.

To adjust UDI Token settings:

1. Tap "Send tokens" to select the desired output for acquired UDI data.

Tokens only - DataWedge parses the UDI data into separate Tokens for output (separated by a separator character, if selected).

Barcodes and tokens - DataWedge sends the barcode string appended by the tokenized data. If no separator character is selected (see Step 2), DataWedge sends two instances of the same data.

2. Tap "Token separator" in the Token selection screen to specify a separator character to be inserted between Tokens, if desired. If "Barcode and tokens" mode is selected, the selected character also is inserted between the two. This setting is not available if "Send tokens" is disabled.

3. Tap "Token order" to include/exclude Tokens from the output and adjust their output order. Drag tokens to adjust output order.


MultiBarcode Data Output

This setting applies when the Scanning mode in Barcode Reader Params is set to MultiBarcode, which simultaneously acquires the number of barcodes (from 2-10) specified in the corresponding reader parameter.

Note: Supported on select devices only. See the About page for details.

To configure MultiBarcode output:

1. Tap "Data formatting and ordering" to specify a separator character to be inserted between the data from each barcode.
2. Tap "Barcode separator" to specify the desired insertion character (CR, LF or TAB).
Data from each barcode is otherwise concatenated and delivered as a single string of keystrokes.


Hexadecimal Data Output

Hex data is based on the encoded data received from the scanner framework after it's converted from its raw form to the selected character set. When the hex-output option is selected, the plain-text string is converted to the corresponding hex digits and output as a string. That hex data can be acquired programmatically.

The Java command below returns the hex data stored in the keystroke or intent output string:


String hex = Hex.encodeHex(data.getString(DATA_STRING_TAG).toCharArray(), false);

For more information and to enable hex output using the DataWedge UI, see Basic Data Formatting (BDF).


Other DataWedge Output Options:

  • Internet Protocol - outputs data over a network using TCP or UDP
  • Intent - delivers data to the app as an intent extra

Related guides: