Preh-Werke GmbH & Co. KG Aditron AG An der Stadthalle 97616 Bad Neustadt a. d. Saale Germany email: [email protected] Web: http://www.preh.com

Conversion of ASCII characters to Scancodes

Basic Notes All keyboard modules – and especially the MSR module - communicate with the keyboard electronics using ASCII-Codes. The Preh-Keyboard then converts these ASCII characters into Scancodes and sends them to the PC. The PC operating system then converts these Scancodes back to characters again.

Direct support for the 8 "predefined languages" For a correct translation of this ASCII-Data into the scancodes for the configured PC keyboard driver, you have to pay attention to the following: The country setting in the keytable has to be set to the same setting, matching the keyboard driver on the target computer system (GR=Germany, US=USA, ...).

Nevertheless on the magnetic stripe tracks only a limited code set is valid, according to the matching ISO standards. Normally only three codes are available to put national specific there: 0x5B, 0x5C, 0x5D. By default these three characters are translated with the scancodes for []\. If you need to get these characters automatically converted to some national ASCII codes, just follow the steps below.

ASCII-Convert-Table If a keyboard driver needs to be used, differing from the 8 predefined country settings, some "hand work" is necessary to get the correct characters. This "ASCII-Convert-Table" can either be done in the DOS Programmer Preh-MWX.EXE and also in the WinProgrammer.

First of all, you have to choose a keyboard language which is most similar to your OS keyboard driver setting. If all characters are equal, most of the work is already done. If not, you have to convert the non- matching characters to your keyboard language code.

In the following example it is described to convert the above mentioned national-specific ASCII characters (0x5B, 0x5C, 0x5D) into user-defined scancodes. If other MSR characters are not sent correctly, you have to do it the same way.

Example: Æ – Character (ISO7811, nordic countries' special character)

On ISO7811 Track1 the character is found here: ASCII 0x5B which then has to be translated into scancodes (key strokes) for the nordic countries' keyboard driver setting:

Shift key Down 2A Æ key Down 27 Æ key Up A7 Shift key Up AA

Convert table: ASCII 0x5B = 2A 27 A7 AA

Note: Which scancodes represent the individual key can be found on so-called "Scancode tables, Scanset #1). But the easiest way to find the scancodes is to use our tool PC-GC.COM, which is part of our DOS programmer package. Just press the key sequence on a standard keyboard and note down the scancodes which are sent when pressing/releasing the keys.

Last modified: 14.12.01 S:\Dokumente\Keyboard\ACSII-Convert\Conversion ASCII to Scancodes.doc Page 1/2 Programming the ASCII-Convert-Table Now you have to tell the Programming software, how this formerly "wrong translated" ASCII-Code should now be translated into scancodes – this is described in the following points:

DOS Programmer Preh-MWX.EXE In our DOS Programmer Preh-MWX.EXE this can be done quite easy via Menu "Edit->ASCII-Convert Table" – just enter the ASCII value and then the scancodes as noted below:

ASCII 0x5B = 2A 27 A7 AA

Then download the modified keytable into the keyboard.

WinProgrammer When using the WinProgrammer, you have to do it this way:

• Open your existing keytable file (*.MWF) using some text editor (e.g. the windows Notepad).

• Add one line for each ASCII character you want to convert. For the syntax, see the following example for the "Æ" character: #CONVERT: "\x5B=%2AH %27H %A7H %AAH"

• Save this changes – and then download to the keyboard (for example using the WinProgrammer).

• The ASCII-Conversion-Table is available after restart.

14.12.01 sz/mk,1723 Preh Data Entry Service.

Conversion ASCII to Scancodes.doc 14.12.01 Page 2/2