The keyboard customisation option allows you to change how keys on your keyboard behave in DP4 applications. For example the default userdata.sys for Windows maps Shift+F1 to F11, so the keys behave identically in DP4 applications, and you might want to change this to enable the keys to behave differently. You can even reprogram most alphanumeric keys - you might want to do this if you were designing something like a restaurant system, where special keyboards are used and alpha keys are not required.
In order to understand the keyboard customisation facility it will help to know a little about how DP4 treats the keyboard. In what follows a normal key means any kind of key that is marked with one or more symbols that the user expects to appear on screen when he presses the key, and a grey key denotes any kind of key which normally has a special function. (At one time PC keyboards typically used different colours for the two types of key). Modifier keys such as Ctrl,Shift, Alt do not generate keystrokes themselves, but change the values generated by other keys.
Real keyboards can have keys that behave in a wide variety of ways: for example function keys on terminals, may generate strings of several characters rather than a single value. On Windows and some other systems, reading the keyboard accurately involves asking the operating system whether the various modifier keys are pressed or not, as well as just reading a raw key value.
However the terminal or operating system behaves, DP4 arranges matters so that at the lowest level all keystrokes are mapped into a value between 0 and 255 in which all "normal" keys appear in their natural position (i.e. their ASCII value). Grey keys are mapped into values of 128 and above, using a scheme that allows for as many different keystrokes as possible (i.e. at this stage Shift+F1 and F11 are mapped to different values).
Next the value generated by this process is put through the key translate table stored in USERDATA.SYS, which the Keyboard Customisation facility changes. At this stage the two different values that are generated by pressing Shift+F1 and F11 are both mapped into the value that means F11 to DP4, unless you have already changed the key translate table.
However, not all keys are actually translated: in particular the upper 128 values are only translated if they were generated by some kind of grey key. Without this it would be impossible for DP4 to support both function keys and accented characters or other keys that generate values outside the 7-bit ASCII range (such as the £ or € currency symbols). So although you can reprogram alpha keys in the lower half of the table to generate function key values, you cannot do the same for accented characters. (This has implications for OSDIs that handle special keyboards on behalf of DP4)
Also Alt+key combinations are not put through the translate table. They are hard-translated to values that DP4 recognises as an Alt+key value.
In fact DP4 translates all input from whatever source, into some kind of virtual keystroke. Only the first 128 values, and Grey versions of values in the second 128 values can be translated.
When you select keyboard customisation, a menu is displayed from which you can choose either option 1: Display current function key settings (i.e. display the keyboard translate table), or option 2: Change current function key settings to change it.
Keys that have some kind of "edit" function are displayed with a three letter code. When you choose option 2 the screen that is displayed will explain that these codes mean.
To modify keys, proceed as follows:
Press a key that you want to modify.
Use the menu that appears to select the modified value you want the key to generate (for Other ASCII value and Other Function key you will also need to enter the value afterwards).
Repeat steps 1 and 2 as often as necessary, and then press Q to exit (not Escape - that will allow you to reprogram the Esc key). You may want to choose option 1 to verify that you have made the changes you intend and no others. Then choose Exit, when you will be prompted to save or abandon your changes. It is probably a good idea to only make a few changes at a time, and then to check that your useradta.sys is still usable.
DFSETUP will normally prevent alphanumeric keys from being reprogrammed - if you really want to reassign an alphanumeric key, run DFSETUP with the -anykey command tail. To reprogram Q you will need to use the -Q x option, where x is some other alpha key.
Although it is obvious, it can be frustrating: if two keys on the keyboard behave identically at the level on which DP4's "raw" keyboard functionality works, it is impossible for them to be treated separately. For example Ctrl+H and Backspace generate the same low level value (8) and therefore have to be mapped to the same functionality in DP4.
Some operating systems completely take over certain keystrokes. For example the F10 key on Windows has a special significance which means that it cannot be used in DP4 like other function keys. It would be very difficult, and probably wrong, for DP4 to try to force F10 into behaving like an ordinary key, because users who are familiar with Windows will expect DP4 programs to behave in the same way with F10 as other applications. However this type of behaviour can be very annoying if you are porting a system from one environment to another because it means users familiar with the old way of doing thisngs need a certain amount of retraining.