
46
2.0 Getting Started
Example: Hex dump of serial data
To test the above example, copy and paste the code into the script re-
placing the default implementation of onData(). Use Timeout as the
Data String Terminator. Connect a serial device to the serial port and
make it generate some data. Below is the output when reading a barcode
containing “W1711010814107013621” using a serial barcode reader:
The last character 0d (hexadecimal) is the same as 13 in decimal nota-
tion. The ASCII character with code 13 is carriage return. This means
the barcode reader is using carriage return (<cr>) as its data string ter-
minator.
2.10.4.4 onHotKey(name)
This method is called when you press a hot key.
The argument to this method is the name of the hot key that was pressed.
Example: Message box displaying the hot key’s name
When executed, the above method will display a message box with the
name of the hot key:
2.10.4.5 onKeyboardCapture(name, data)
Called when a keyboard capture string has been received.
The arguments to this method are the name of the keyboard capture
and the data.
Example: Display the name and data of a keyboard cap-
ture event
If you have a keyboard captured defined called My USB Scanner and
it captures the string 73105541 the method in the above example will
display this dialog:
2.10.4.6 onExternalData(data, length)
Called when an external application sends data to Link*One.
The arguments are the received data and the length of it.
External applications can send data to Link*One. They do it by finding
the window handle of Link*One’s window and then send a WM_COPY-
DATA message to the window.
Example: Display data and length sent to Link*One from
an external application
This feature makes it possible to create an application that integrates
tightly with Link*One. For example, the code in onExternalData() could
relay the data to a scanner to make it beep, initiate a scan, configure it etc.
2.10.4.7 onTimer()
Called periodically at the specified timer interval.
This method receives no arguments.