arch_debug_blue_screen_getchar() can now also return escape sequences for cursor

movement - IOW, the history of kernel debugger calls is now working also from
the on-screen KDL.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14000 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-08-20 20:53:44 +00:00
parent ae124a62f8
commit ed73e0eefa

View File

@ -101,15 +101,29 @@ arch_debug_blue_screen_getchar(void)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
};
enum keycodes {
LSHIFT = 42,
RSHIFT = 54,
LSHIFT = 42,
RSHIFT = 54,
CURSOR_LEFT = 75,
CURSOR_RIGHT = 77,
CURSOR_UP = 72,
CURSOR_DOWN = 80,
};
static bool shift = false;
static uint8 last = 0;
static uint8 special = 0;
uint8 key, ascii = 0;
if (special & 0x80) {
special &= ~0x80;
return '[';
}
if (special != 0) {
key = special;
special = 0;
return key;
}
while (true) {
uint8 status = in8(PS2_PORT_CTRL);
@ -133,10 +147,29 @@ arch_debug_blue_screen_getchar(void)
shift = false;
} else {
// key down
if (key == LSHIFT || key == RSHIFT)
shift = true;
else
return shift ? shifted_keymap[key] : unshifted_keymap[key];
switch (key) {
case LSHIFT:
case RSHIFT:
shift = true;
break;
// start escape sequence for cursor movement
case CURSOR_UP:
special = 0x80 | 'A';
return '\x1b';
case CURSOR_DOWN:
special = 0x80 | 'B';
return '\x1b';
case CURSOR_RIGHT:
special = 0x80 | 'C';
return '\x1b';
case CURSOR_LEFT:
special = 0x80 | 'D';
return '\x1b';
default:
return shift ? shifted_keymap[key] : unshifted_keymap[key];
}
}
}
}