Documentation

This documentation matches version 1.0.0-RC1 of our software. Download the latest release here.

  1. Intended use
  2. Supported connections and protocols
  3. Configuring 232key Pro
  4. Start and Stop

Intended use

232key Pro is a scriptable keyboard wedge software. It captures data received from a connected device, runs it through your custom C# script and outputs it as simulated keyboard strokes.

Simplified 232key Pro Data Flow
See Scripts page for a more detailed diagram

232key Pro was developed for advanced scenarios where the flexibility and power of a custom script is required. It is intended for users who are somewhat familiar with the C# programming language. Simpler versions of 232key can be found on 232key.com.

Supported connections and protocols

232key Pro supports connections made through a COM port (RS232, USB virtual COM port, Bluetooth Serial Port Profile, etc.) or over TCP/IP (Ethernet, WLAN; the program acts as TCP client on a persistent connection). Your device should preferably send ASCII characters, though you could decode other formats and possibly add support for other protocols through your script.

Configuring 232key Pro

232key Pro is organized in tabs. The Start tab is shown when the software is first launched:
232key Pro Start tab (fresh installation)
To configure 232key Pro, go to the Input tab to make settings related to your connected device. The Script tab allows you to enter your script (or load it from a file). Polling with a hotkey (keyboard shortcut) can be set up in the Control tab. The Settings tab contains general program settings, most importantly the Output method and Encoding. License keys can be entered and managed in the License tab.

Input tab

Used for settings related to the connected device:
232key Pro input tabIf your Device is included in the list, select it and press Set default parameters for device to automatically set the interface parameters (bits/s, etc.) and the Terminator. If your device is not included, select either “Generic measuring instrument” or “Generic text device” (e.g. for bar code readers) and set the interface parameters and Terminator manually. It is essential that all settings match those of your device or communication will fail.

Currently included device profiles:

If you’re a manufacturer and would like us to include your instruments, please contact us.

COM port or TCP/IP

Choose between a COM port (RS232, USB VCP, Bluetooth SPP) or a TCP/IP connection by selecting the appropriate radio button.

Note: For TCP/IP connections, we currently only support persistent connections where 232key Pro acts as the TCP client and connects to a device acting as the TCP server. 232key Pro gives you access to the “raw TCP” data, though you might be able to implement higher-level application protocol in your script.

If you’re not sure which COM port your device is connected to, open the device manager in Windows and consult the “Ports (COM & LPT)” section. When you plug in and unplug a USB VCP device, you should see a COM port appear or disappear:

Ohaus scale with USB interface appearing as COM4
Windows Device Manager / Ports (COM & LPT)

Terminator or Timeout

The stream of bytes sent by your device has to be transformed into meaningful strings (“lines of data”). This can be achieved by using a Terminator (a.k.a delimiter) or a Timeout.

The Terminator is the very last character in each line of data sent by your device. If your device is included in the device list and you’ve pressed the Set default parameters for device button, the terminator will be set automatically. You can also select one of the values from the combo box or enter any ASCII code as a decimal value.

Terminator example from a user manual

In the example above, the very last character is “line feed” (ASCII code 10).

As an alternative to using a terminator, 232key Pro also supports a Timeout: If no additional data has been received in the specified time, the program assumes that the line of data is complete. Enter the Timeout in milliseconds (100 ms is usually a good starting point) and leave the Terminator field empty (you can also use both, but this is usually not what you want).

Tip: If you don’t know which terminator your device uses, leave the Terminator field empty and try entering a Timeout of 100 ms. Then, transfer some data from your device and take a look at the Event Log in the Start tab. You’ll usually be able to identify the terminator as the last code received in each line (10 in the example below, numbers in <brackets> are decimal ASCII codes of non-printable characters). Once you’ve set the Terminator, don’t forget to delete the Timeout as it is no longer needed.
232key Pro find terminator

Flow control (handshaking)

232key Pro supports XON/XOFF software flow control and RTS/CTS hardware flow control for COM ports (and a rarely used mode that uses both). In addition to these methods, you can also enable the “data terminal ready” (DTR) and “request to send” (RTS) control signals for the duration of the connection by clicking on the corresponding button:
232key Pro flow control (handshaking)Note: You cannot manually set the RTS signal when using RTS flow control.

We recommend setting Flow control to “None” and only enabling it if required by your serial device.

Customize the Regular Expression used to match data

232key Pro uses a Regular Expression (regex) to match data which is then made available to your script.

You can display and edit the regex by clicking on the Customize button:
Regular Expression in 232key Pro

Important: You must include a capturing group in your regular expression. The captured data will be made available to your script in the value variable, see the Scripts documentation for further information.

Notes:

  • Regular expressions use the C# .NET syntax.
  • Customized regular expressions will not be overwritten unless you change the Device, press Set default parameters and confirm overwriting in the dialog that appears.

Control tab

Use this tab to send a command to your device when the user presses a key combination:
232key Pro control tab

Polling with a Hotkey (keyboard shortcut)

Enable polling if you want to use a Hotkey to send a Command to your device. Example: Many scales and balances will send the current weight after receiving a corresponding command.

To change the Hotkey, click in the field and press a key combination with Ctrl, Alt or Shift and one other key.

The command has to be entered as a 2 Hexadecimal characters per byte, separated by a blank space. The ASCII text is shown for reference purposes. In the screenshot above, “51  0D 0A” results in “Q” followed by carriage control and line feed (the query command used by A&D weighing instruments).

If the Set default command button is active, you can press it to set the default polling command for the selected device. Otherwise, please consult the manual of your device to and use tools like asciitohex.com for the conversion.

Note: If your device answers very quickly, the user might still be holding a modifier key when 232key starts typing, resulting in unexpected behaviour. Consider adding a delay in your script, e.g. 200 ms:

await System.Threading.Tasks.Task.Delay(200);

Script tab

You can load your custom C# script from a file or enter it directly in the text box.
232key Pro script tabA very basic script is shown by default: value contains the string matched by the first capturing group of the regular expression (defined in the Input tab). For most devices, value is the first number from each received line of data. If nothing has been matched, it contains an empty string.

The script adds a newline character (to press the ENTER key) after the value and returns the string to 232key Pro for output as keystrokes.

Further information can be found in the Scripts documentation.

Settings tab

Event Log settings

232key Pro Event Log settings

Un-check Show received data and Show sent data if you only want status and error messages to appear (but no data received from or sent to the connected device). This can be useful if data is sent at a very high rate and should generally not be necessary.

Disable Auto scroll if you want to prevent 232key Pro from automatically scrolling to the latest entry in the event log.

The number of Lines before the event log is restarted (overwritten) can be set from 10 to 1000.

Output method

232key Pro Output Method: Default or GIDEI

By default, 232key simulates keystrokes by sending the string returned from your script to the input buffer as Unicode characters. This allows all characters to be typed irrespective of keyboard layout settings.

The downside of this method is that you cannot type non-alphanumerical keys (the only exception being \t = TAB and \n = ENTER). Pressing key combinations is also not possible. To overcome these issues, 232key Pro has (experimental) support for the General Input Device Emulating Interface (GIDEI) protocol, which was implemented in all versions of Windows up to XP as “SerialKeys”. Please see the GIDEI section on the scripts page for further information on supported keys and commands.

General settings

Note: We may change the grouping or tab location of these settings in future releases.

232key Pro general settings

Encoding

Choose between ASCII, UTF-8 and ISO-8859-1. This only affects the initial decoding of bytes received from your device.

Ignore received lines consisting only of white-space characters

232key Pro will ignore “empty” strings received from your device which only contain white-space characters like carriage return and line feed. This means that further processing will be skipped and these string will not be passed to your script.

Start automatically with program start

Eliminates the need to press the Start button. The program will connect to your device and start the script and keyboard output automatically.

Notes:

  • If you want 232key Pro to run automatically when Windows starts, place a shortcut in the “startup” folder. See below for instructions.
  • Compiling the script after the program has started will take a few seconds.
  • If you’re using a trial version, you may have to acknowledge a message when the program starts.
Starting 232key Pro with Windows

This method does not work for the ClickOnce version of 232key. Please use the conventional installer.

Locate 232key.exe by pasting the following path in the address bar of the File Explorer:
%ProgramFiles%\Smartlux\232key Pro

To open a second File Explorer window with the startup folder, press the Windows key and R and enter “shell:startup” (to start 232key Pro for the current user) or “shell:common startup” (to start it for all users).

open startup folder

Place both windows side-by-side. Hold the Alt key, click on 232key.exe and drag it to the startup folder. Release the mouse button before releasing Alt. This will create a link (shortcut):

232key Pro shortcut

Be careful not to confuse 232key.exe and the 232key Pro.ico icon file!

Reload and Reset

232key Pro reload or reset user settings

Press Reload to restore the last saved user settings (settings are saved automatically when the application is closed). This is useful if you want to undo changes that you’ve made in the current session. Reset will reset all user settings to their default values (as if you’d just installed 232key Pro).

Copy settings from beta version

Copy settings from beta version

Press Copy from beta version if you have 232key Pro 9.9.9-beta installed and want to copy the settings to version 1.0.0 or later. This will overwrite all current settings.

Note: If you have a license key, please enter it again as it cannot be copied.

Start and Stop

Return to the Start tab and press the Start button. Switch to the target application (where you want 232key Pro to enter the data).

If you do not switch to the target application before data from the connected device is received, 232key will likely press the Stop button on it’s on user interface.

The Event Log will show data sent to and received from your device (unless configured otherwise) as well as error and status messages. The screenshot below shows sent data and received data, with data in capturing group 1 in blue (i.e the value variable passed to your script).

Press Stop to stop 232key Pro:
232key polling with hotkey (event log)