2 Copyright (C) 1998 BJ Eirich (aka vecna)
\r
3 This program is free software; you can redistribute it and/or
\r
4 modify it under the terms of the GNU General Public License
\r
5 as published by the Free Software Foundation; either version 2
\r
6 of the License, or (at your option) any later version.
\r
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
10 See the GNU General Public Lic
\r
11 See the GNU General Public License for more details.
\r
12 You should have received a copy of the GNU General Public License
\r
13 along with this program; if not, write to the Free Software
\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
22 // ================================= Data ====================================
\r
25 char keycode,last_pressed=0;
\r
26 char codeBuffer[16];
\r
27 void (__interrupt __far *biosKeyboardHandler)();
\r
28 char handlerinstalled=0;
\r
30 unsigned char key_ascii_tbl[128] =
\r
32 0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 8, 9,
\r
33 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', 13, 0, 'a', 's',
\r
34 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39, 0, 0, 92, 'z', 'x', 'c', 'v',
\r
35 'b', 'n', 'm', ',', '.', '/', 0, '*', 0, ' ', 0, 3, 3, 3, 3, 8,
\r
36 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0,
\r
37 0, 0, 0, 127, 0, 0, 92, 3, 3, 0, 0, 0, 0, 0, 0, 0,
\r
38 13, 0, '/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
\r
39 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', 0, 0, 0, 0, 0
\r
42 unsigned char key_shift_tbl[128] =
\r
44 0, 0, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', 126, 126,
\r
45 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', 126, 0, 'A', 'S',
\r
46 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', 34, 0, 0, '|', 'Z', 'X', 'C', 'V',
\r
47 'B', 'N', 'M', '<', '>', '?', 0, '*', 0, 1, 0, 1, 1, 1, 1, 1,
\r
48 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, '-', 0, 0, 0, '+', 0,
\r
49 0, 0, 1, 127, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
\r
50 13, 0, '/', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
\r
51 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/', 0, 0, 0, 0, 0
\r
54 // ================================= Data ====================================
\r
56 void __interrupt __far KeyboardHandler()
\r
64 last_pressed=keycode;
\r
72 if (handlerinstalled) return;
\r
74 biosKeyboardHandler=_dos_getvect(0x09);
\r
75 _dos_setvect(0x09, KeyboardHandler);
\r
79 void ShutdownKeyboard()
\r
81 if (handlerinstalled)
\r
82 _dos_setvect(0x09, biosKeyboardHandler);
\r