HTBasic Help
×
Menu
Index

CONFIGURE KBD

Defines keyboard mappings for character sets.
 
 CONFIGURE KBD first-char TO string-name$
 
Where:
first-char = numeric-expression rounded to an integer.
 
Usage:
CONFIGURE KBD 129 TO Mapping$
 
Example:      CONFIGURE KBD.BAS
 
Description:
CONFIGURE KBD defines keyboard mappings for character sets not supported by your operating system. When in effect, CONFIGURE KBD substitutes characters from the given string in place of characters that come from the keyboard. This remapping is good for ASCII characters, but does not apply to function keys. (Use CONFIGURE KEY to redefine function keys.) CONFIGURE KBD is not intended to be a complete keyboard driver, it merely substitutes one ASCII value for another. The range of ASCII values which are remapped starts at first-char and extends to (first-char - LEN(string-name$) - 1). The string specifies the ASCII values which should be substituted for values in that range.
 
For example, if the keyboard is producing characters from the PC Code Page 850 character set, but the display has been set up to display the HP Roman-8 character set, the following program will cause characters from the keyboard to be translated to the display character set so that characters are displayed with the same glyphs as printed on the keyboard. If the keyboard is used to produce a character not in the HP Roman-8 character set, it is translated to CHR$(252), a solid block.
 
!setkbd2.bas
DATA  0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
DATA  16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
DATA  32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
DATA  48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
DATA  64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
DATA  80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
DATA  96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111
DATA  112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
DATA  180,207,197,192,204,200,212,181,193,205,201,221,209,217,216,208
DATA  220,215,211,194,206,202,195,203,239,218,219,214,187,210,252,190
DATA  196,213,198,199,183,182,249,250,185,252,252,248,247,184,251,253
DATA  252,252,252,252,252,224,162,161,252,252,252,252,252,191,188,252
DATA  252,252,252,252,252,252,226,225,252,252,252,252,252,252,252,186
DATA  228,227,164,165,163,252,229,166,167,252,252,252,252,252,230,252
DATA  231,222,223,232,234,233,243,241,240,237,174,173,178,177,176,168
DATA  246,254,252,245,244,189,252,252,179,171,242,252,252,252,252,255
DIM Pc2hp$[256]
CLEAR SCREEN
PRINT "Set up PC (Code page 850) to HP (Roman-8) translation string"
FOR I=0 TO 255
  READ C
  Pc2hp$[I+1;1]=CHR$(C)
NEXT I
CONFIGURE KBD 0 TO Pc2hp$
END
 
See Also: