8 #include <sys/farptr.h>
15 static volatile char key[128];
21 unsigned char uchStatus;
24 uchStatus = inportb(0x64);
25 }
while( ((uchStatus & 0x02)!=0) && --count );
26 outportb( 0x64, uchValue );
27 return (uchStatus & 0x02)==0;
35 unsigned char scancode_raw;
40 scancode_raw = inportb(0x60);
43 printf(
":%02x", scancode_raw);
49 regs.h.al = scancode_raw;
50 __dpmi_int(0x15, ®s);
51 if( regs.x.flags & 1 )
55 size_t code = regs.h.al;
57 size_t code = scancode_raw;
65 int release_code = (code & 0x80)!=0;
83 unsigned int beg, end, fre, nxt;
84 unsigned short old_sel;
86 old_sel = _fargetsel();
89 beg = _farnspeekw( (0x40 << 4) | 0x80 );
90 end = _farnspeekw( (0x40 << 4) | 0x82 );
91 fre = _farnspeekw( (0x40 << 4) | 0x1C );
92 nxt = _farnspeekw( (0x40 << 4) | 0x1A );
94 if( (fre == nxt - 2) || ((nxt == beg) && (fre == end - 2)) )
101 _farnspokew( (0x40 << 4) | 0x1A, nxt);
104 kbflags = _farnspeekb( (0x40 << 4) | 0x17 );
131 if( kbflags & (1 << 6) )
134 if( kbflags & (1 << 5) )
191 if( scancode >=
sizeof(
key ) )