[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
unit ECO_kbd;
interface
const
enableenhanced : boolean = true; { false disables intr }
digits : array[0..$f] of char = '0123456789ABCDEF';
{ plain shifted control alternate }
_esc =$011b;_s_esc =$011b;_c_esc =$011b;_a_esc =$0100;
_f1 =$3b00;_s_f1 =$5400;_c_f1 =$5e00;_a_f1 =$6800;
_f2 =$3c00;_s_f2 =$5500;_c_f2 =$5f00;_a_f2 =$6900;
_f3 =$3d00;_s_f3 =$5600;_c_f3 =$6000;_a_f3 =$6a00;
_f4 =$3e00;_s_f4 =$5700;_c_f4 =$6100;_a_f4 =$6b00;
_f5 =$3f00;_s_f5 =$5800;_c_f5 =$6200;_a_f5 =$6c00;
_f6 =$4000;_s_f6 =$5900;_c_f6 =$6300;_a_f6 =$6d00;
_f7 =$4100;_s_f7 =$5a00;_c_f7 =$6400;_a_f7 =$6e00;
_f8 =$4200;_s_f8 =$5b00;_c_f8 =$6500;_a_f8 =$6f00;
_f9 =$4300;_s_f9 =$5c00;_c_f9 =$6600;_a_f9 =$7000;
_f10 =$4400;_s_f10 =$5d00;_c_f10 =$6700;_a_f10 =$7100;
_f11 =$8500;_s_f11 =$8700;_c_f11 =$8900;_a_f11 =$8b00;
_f12 =$8600;_s_f12 =$8800;_c_f12 =$9000;_a_f12 =$8c00;
_pad_slash =$e02f;_s_pad_slash =$e02f;_c_pad_slash =$9500;_a_pad_slash =$a400;
_asterisk =$372a;_s_asterisk =$372a;_c_asterisk =$7200;_a_asterisk =$3700;
_pad_minus =$4a2d;_s_pad_minus =$4a2d;_c_pad_minus =$8e00;_a_pad_minus =$4a00;
_pad_home =$4700;_s_pad_home =$4737;_c_pad_home =$7700;_a_pad_home =$9700;
_pad_up =$4800;_s_pad_up =$4838;_c_pad_up =$8d00;_a_pad_up =$9800;
_pad_pgup =$4900;_s_pad_pgup =$4939;_c_pad_pgup =$8400;_a_pad_pgup =$9900;
_pad_plus =$4e2b;_s_pad_plus =$4e2b;_c_pad_plus =$9000;_a_pad_plus =$4e00;
_pad_left =$4b00;_s_pad_left =$4b34;_c_pad_left =$7300;_a_pad_left =$9b00;
_pad_center=$4c00;_s_pad_center=$4c35;_c_pad_center=$8f00;_a_pad_center=$9c00;
_pad_right =$4d00;_s_pad_right =$4d36;_c_pad_right =$7400;_a_pad_right =$9d00;
_pad_end =$4f00;_s_pad_end =$4f31;_c_pad_end =$7500;_a_pad_end =$9f00;
_pad_down =$5000;_s_pad_down =$5032;_c_pad_down =$9100;_a_pad_down =$a000;
_pad_pgdn =$5100;_s_pad_pgdn =$5133;_c_pad_pgdn =$7600;_a_pad_pgdn =$a100;
_pad_enter =$e00d;_s_pad_enter =$e00d;_c_pad_enter =$e00a;_a_pad_enter =$a600;
_pad_ins =$5200;_s_pad_ins =$5230;_c_pad_ins =$9200;_a_pad_ins =$a200;
_pad_del =$5300;_s_pad_del =$532e;_c_pad_del =$9300;_a_pad_del =$a300;
_tab =$0f09;_s_tab =$0f00;_c_tab =$9400;_a_tab =$a500;
_lbracket =$1a5b;_s_lbracket =$1a7b;_c_lbracket =$1a1b;_a_lbracket =$1a00;
_rbracket =$1b5d;_s_rbracket =$1b7d;_c_rbracket =$1b1d;_a_rbracket =$1b00;
_backslash =$2b5c;_s_backslash =$2b7c;_c_backslash =$2b1c;_a_backslash =$2b00;
_semicolon =$273b;_s_semicolon =$273a;_c_semicolon =$2700;_a_semicolon =$2700;
_quote =$2827;_s_quote =$2822;_c_quote =$2800;_a_quote =$2800;
_comma =$332c;_s_comma =$333c;_c_comma =$3300;_a_comma =$3300;
_period =$342e;_s_period =$343e; _a_period =$3400;
_slash =$352f;_s_slash =$353f; _a_slash =$3500;
_space =$3920;_s_space =$3920;_c_space =$3920;_a_space =$3920;
_ins =$52e0; _c_ins =$92e0;_a_ins =$a200;
_home =$47e0; _c_home =$77e0;_a_home =$9700;
_pgup =$49e0; _c_pgup =$84e0;_a_pgup =$9900;
_del =$53e0; _c_del =$93e0;_a_del =$a300;
_end =$4fe0; _c_end =$75e0;_a_end =$9f00;
_pgdn =$51e0; _c_pgdn =$76e0;_a_pgdn =$a100;
_up =$48e0; _c_up =$8de0;_a_up =$9800;
_left =$4be0; _c_left =$73e0;_a_left =$9b00;
_down =$50e0; _c_down =$91e0;_a_down =$a000;
_right =$4de0; _c_right =$74e0;_a_right =$9d00;
_enter =$1c0d;_s_enter =$1c0d;_c_enter =$1c0a;_a_enter =$1c00;
_pad_45 =$565c;_s_pad_45 =$567c;
_backquote =$2960;_s_backquote =$297e; _a_backquote =$2900;
_0 =$0b30;_s_0 =$0b29; _a_0 =$8100;
_1 =$0231;_s_1 =$0221; _a_1 =$7800;
_2 =$0332;_s_2 =$0340;_c_2 =$0300;_a_2 =$7900;
_3 =$0433;_s_3 =$0423; _a_3 =$7a00;
_4 =$0534;_s_4 =$0524; _a_4 =$7b00;
_5 =$0635;_s_5 =$0625; _a_5 =$7c00;
_6 =$0736;_s_6 =$075e;_c_6 =$071e;_a_6 =$7d00;
_7 =$0837;_s_7 =$0826; _a_7 =$7e00;
_8 =$0938;_s_8 =$092a; _a_8 =$7f00;
_9 =$0a39;_s_9 =$0a28; _a_9 =$8000;
_minus =$0c2d;_s_minus =$0c5f;_c_minus =$0c1f;_a_minus =$8200;
_equals =$0d3d;_s_equals =$0d2b; _a_equals =$8300;
_backspace =$0e08;_s_backspace =$0e08;_c_backspace =$0e7f;_a_backspace =$0e00;
_a =$1e61;_s_a =$1e41;_c_a =$1e01;_a_a =$1e00;
_b =$3062;_s_b =$3042;_c_b =$3002;_a_b =$3000;
_c =$2e63;_s_c =$2e43;_c_c =$2e03;_a_c =$2e00;
_d =$2064;_s_d =$2044;_c_d =$2004;_a_d =$2000;
_e =$1265;_s_e =$1245;_c_e =$1205;_a_e =$1200;
_f =$2166;_s_f =$2146;_c_f =$2106;_a_f =$2100;
_g =$2267;_s_g =$2247;_c_g =$2207;_a_g =$2200;
_h =$2368;_s_h =$2348;_c_h =$2308;_a_h =$2300;
_i =$1769;_s_i =$1749;_c_i =$1709;_a_i =$1700;
_j =$246a;_s_j =$244a;_c_j =$240a;_a_j =$2400;
_k =$256b;_s_k =$254b;_c_k =$250b;_a_k =$2500;
_l =$266c;_s_l =$264c;_c_l =$260c;_a_l =$2600;
_m =$326d;_s_m =$324d;_c_m =$320d;_a_m =$3200;
_n =$316e;_s_n =$314e;_c_n =$310e;_a_n =$3100;
_o =$186f;_s_o =$184f;_c_o =$180f;_a_o =$1800;
_p =$1970;_s_p =$1950;_c_p =$1910;_a_p =$1900;
_q =$1071;_s_q =$1051;_c_q =$1011;_a_q =$1000;
_r =$1372;_s_r =$1352;_c_r =$1312;_a_r =$1300;
_s =$1f73;_s_s =$1f53;_c_s =$1f13;_a_s =$1f00;
_t =$1474;_s_t =$1454;_c_t =$1414;_a_t =$1400;
_u =$1675;_s_u =$1655;_c_u =$1615;_a_u =$1600;
_v =$2f76;_s_v =$2f56;_c_v =$2f16;_a_v =$2f00;
_w =$1177;_s_w =$1117;_c_w =$1157;_a_w =$1100;
_x =$2d78;_s_x =$2d58;_c_x =$1519;_a_x =$2d00;
_y =$1579;_s_y =$1559;_c_y =$1519;_a_y =$1500;
_z =$2c7a;_s_z =$2c5a;_c_z =$2c1a;_a_z =$2c00;
var
hasenhancedkbd : boolean; {true when enhanced keyboard is detected}
procedure restorekbdvectors;
function readkeyword : word;
function hexw(w : word) : string;
The following table summarizes the keys which are affected by using this
unit. The entries are the values of the scan word in hex. The high byte of
the scan word is the scan code, the low byte the ASCII character. If the low
byte is 00, the high byte will be returned on the next call to ReadKey. Any
keys not listed are returned in the usual manner (see the Turbo Pascal 4.0
manual, first printing pages 571-572, for a scan code chart). See Notes,
following the table, for the key to special symbols.
Plain Shift Control Alt
----- ----- ------- ----
F11 8500% 8700% 8900% 8B00%
F12 8600% 8800% 8A00% 8C00%
Esc 011B 011B 011B 0100*
Backquote 2960 297E 2960 2900*
Backspace 0E08 0E08 0E7F 0E00*
Tab 0F09 0F00 9400* A500*
Left Brack 1A5B 1A7B 1A1B 1A00*
Right Brack 1B5D 1B7D 1B1D 1B00*
Backslash 2B5C 2B7C 2B1C 2B00*
Semicolon 273B 273A - 2700*
Quote 2827 2822 - 2800*
Enter 1C0D 1C0D 1C0A 1C00*
Comma 332C 333C - 3300*
Period 342E 343E - 3400*
Slash 352F 353F - 3500*
Insert 5200 5230 9200* A200#
Del 5300 532E 9300* A300#
Home 4700 4737 7700 9700#
End 4F00 4F31 7500 9F00#
PgUp 4900 4939 8400 9900#
PgDn 5100 5133 7600 A100#
Up 4800 4838 8D00* 9800#
Down 5000 5032 9100* A000#
Left 4B00 4B34 7300 9B00#
Right 4D00 4D36 7400 9D00#
Pad-Asterisk 372A ! ! 3700# (numeric keypad keys)
Pad-Minus 4A2D 4A2D 8E00* 4A00#
Pad-Plus 4E2B 4E2B 9000* 4E00#
Pad-5 4C00* 4C35 8F00* 9C00#
Notes:
- These keystrokes are ignored.
* These keystrokes are not normally returned by the non-enhanced keyboard.
# These keystrokes are not normally returned by the enhanced keyboard.
! These keystrokes control printscreen and print echoing. They cannot
simulate the effect of the enhanced keyboard, which has the Asterisk and
PrtSc keys separated.
% The F11 and F12 keys are returned only if they actually exist on the
keyboard.
With a few exceptions, the EnhKbd unit returns results identical to those of
the enhanced keyboard BIOS. One difference makes the enhanced keyboard
simpler to use in a program: those scan words which normally contain E0 in
the low byte to indicate that the key is specific to the enhanced keyboard
(like the dedicated cursor keys) will have the low cleared to zero by EnhKbd.
Keys marked with # are normally ignored by the enhanced BIOS. By defining
these numeric keypad keys when Alt is pressed, the usual ability to enter
arbitrary keys on the numeric keypad is disabled. Within applications, the
ability to use alt-shifted arrow keys will generally be more useful. The
arbitrary keys from the numeric keypad are still available by pressing both
Alt and Left Shift simultaneously.
Because this unit takes over interrupt 9, it will crash the system if
SideKick is installed and another TSR that takes over interrupt 9 has been
loaded after SideKick. You must exercise similar caution in using this unit
in programs that must take over interrupt 9 for other reasons.
Uses this unit early in the USES clause!
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson