projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zbuffer done
[dosdemo]
/
src
/
dos
/
keyb.c
diff --git
a/src/dos/keyb.c
b/src/dos/keyb.c
index
55b9013
..
ac200b3
100644
(file)
--- a/
src/dos/keyb.c
+++ b/
src/dos/keyb.c
@@
-214,12
+214,18
@@
static void INTERRUPT kbintr()
{
unsigned char code;
int key, c, press;
{
unsigned char code;
int key, c, press;
+ static int ext;
code = inp(KB_PORT);
code = inp(KB_PORT);
- if(code >= 128) {
+ if(code == 0xe0) {
+ ext = 1;
+ goto eoi;
+ }
+
+ if(code & 0x80) {
press = 0;
press = 0;
- code -= 128;
+ code &= 0x7f;
if(num_pressed > 0) {
num_pressed--;
if(num_pressed > 0) {
num_pressed--;
@@
-230,8
+236,14
@@
static void INTERRUPT kbintr()
num_pressed++;
}
num_pressed++;
}
- key = scantbl[code];
- c = (keystate[KB_LSHIFT] | keystate[KB_RSHIFT]) ? scantbl_shift[code] : key;
+ if(ext) {
+ key = scantbl_ext[code];
+ c = key;
+ ext = 0;
+ } else {
+ key = scantbl[code];
+ c = (keystate[KB_LSHIFT] | keystate[KB_RSHIFT]) ? scantbl_shift[code] : key;
+ }
if(press) {
/* append to buffer */
if(press) {
/* append to buffer */
@@
-251,5
+263,6
@@
static void INTERRUPT kbintr()
/* and update keystate table */
keystate[key] = press;
/* and update keystate table */
keystate[key] = press;
+eoi:
outp(PIC1_CMD_PORT, OCW2_EOI); /* send end-of-interrupt */
}
outp(PIC1_CMD_PORT, OCW2_EOI); /* send end-of-interrupt */
}