Skip to content

Commit

Permalink
键盘输入(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Apr 21, 2016
1 parent df34b85 commit 98c3c56
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions 14_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ void HariMain(void)
struct SHTCTL *shtctl;
struct SHEET *sht_back, *sht_mouse, *sht_win;
unsigned char *buf_back, buf_mouse[256], *buf_win;
static char keytable[0x54] = {
0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0, 0,
'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '@', '[', 0, 0, 'A', 'S',
'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', ':', 0, 0, ']', 'Z', 'X', 'C', 'V',
'B', 'N', 'M', ',', '.', '/', 0, '*', 0, ' ', 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, '7', '8', '9', '-', '4', '5', '6', '+', '1',
'2', '3', '0', '.'
};

init_gdtidt();
init_pic();
Expand Down Expand Up @@ -83,8 +91,12 @@ void HariMain(void)
if (256 <= i && i <= 511) { /* 键盘数据*/
sprintf(s, "%02X", i - 256);
putfonts8_asc_sht(sht_back, 0, 16, COL8_FFFFFF, COL8_008484, s, 2);
if (i == 0x1e + 256) {
putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, "A", 1);
if (i < 256 + 0x54) {
if (keytable[i - 256] != 0) {
s[0] = keytable[i - 256];
s[1] = 0;
putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, s, 1);
}
}
} else if (512 <= i && i <= 767) { /* 鼠标数据*/
if (mouse_decode(&mdec, i - 512) != 0) {
Expand Down

0 comments on commit 98c3c56

Please sign in to comment.