HTBasic Help
×
Menu
Index

Keyboard

 
The statement CONFIGURE KBD has been added to HTBasic to allow simple keyboard character set re-mapping. (This is different than CONFIGURE KEY, which re-maps function and editor keys.) CONFIGURE KBD is not a complete keyboard driver. It uses a look-up table to translate characters from one character set to another.
The files PCTOR8.KBD (formerly HP200.KBD) and L1TOR8.KBD contain the necessary keyboard re-mappings from code page 850 and Latin-1 to Roman-8. The following program will set up the re-mapping. Use either PCTOR8 or L1TOR8 in line 60, depending on the character set in use by the operating system keyboard driver. Where no translation exists for a character, CHR$(252) is returned.
 
10   !SETKBD.BAS
20   DIM Pc2hp$[256]
30   CLEAR SCREEN
40   PRINT "Set up translation string to Roman-8"
60   ASSIGN @Io TO "PCTOR8.KBD" !Use L1TOR8 for Latin-1
70   ENTER @Io;Pc2hp$
80   ASSIGN @Io TO *
90   CONFIGURE KBD 0 TO Pc2hp$
100  END
 
To enter a character without re-mapping, use the ANY CHAR function.
 
The syntax of the CONFIGURE KBD statement is:
 
CONFIGURE KBD First_char TO String$
 
where First_char is a numeric expression, rounded to an integer, that gives the first keyboard character to be re-mapped, and the first character in String$ gives the display character that it is re-mapped to. If the length of String$ is longer than one, then additional characters following First_char are also re-mapped.