This documentation matches version 0.9.6 of our software. Download the latest release here.
- Intended use
- Supported connections and protocols
- Configuring 232key Pro
- Input tab
- Control tab
- Script tab
- Settings tab
- Start and Stop
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.
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.
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.
232key Pro is organized in tabs. The Start tab is shown when the software is first launched:
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.
Used for settings related to the connected device:
If 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:
- Generic measuring instrument
- Generic text device
- A&D scales and balances
- A&D LCCU21 USB button load cell
- Acculab AL balances
- Adam Equipment CBK, GBK, GFK (GK indicator)
- Adam Equipment CPWplus
- Adam Equipment GBC, GFC (GC counting indicator)
- Adam Equipment HCB (“Highland”)
- Denver Instrument balances (same as Sartorius legacy).
- Kern DE series scales
- Kern 572, 573, KB, DS and FKB scales (also works for other Kern scales manufactured in Germany)
- Kern KFB indicator (used by Kern IFB platform scales)
- Mars Scale
- Mettler-Toledo MT-SICS protocol
- MyWeigh Ultraship U-2 (only recent models which appear as a COM port when connected to a PC, polling is not supported by this scale)
- Ohaus scales and balances
- Ohaus Scout Pro (SPU), Traveller (TA), Navigator (NV, NVT) scales
- Sartorius balances:
- Legacy devices,
- Sartorius Entris, EK, GK and GW,
- Sartorius SBI protocol,
- Sartorius SICS protocol.
- Scale Manufacturers Association Standard Scale Serial Communication Protocol (supported by several manufacturers)
If you’re a manufacturer and would like us to include your instruments, please contact us.
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:
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.
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 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:
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.
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:
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.
- 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.
Use this tab to send a command to your device when the user presses a key combination:
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:
You can load your custom C# script from a file or enter it directly in the text box.
A 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.
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.
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.
Note: We may change the grouping or tab location of these settings in future releases.
Choose between ASCII, UTF-8 and ISO-8859-1. This only affects the initial decoding of bytes received from your device.
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.
Eliminates the need to press the Start button. The program will start automatically with the last used settings.
- If you want 232key Pro to run automatically when Windows starts, place a shortcut in the “startup” folder. See this article for further information.
- Compiling the script after the program has started will take a few seconds.
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 SDL).
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: