mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-09 12:55:06 +08:00
控制光标闪烁(1)
This commit is contained in:
@@ -190,10 +190,12 @@ void HariMain(void)
|
||||
key_to = 1;
|
||||
make_wtitle8(buf_win, sht_win->bxsize, "task_a", 0);
|
||||
make_wtitle8(buf_cons, sht_cons->bxsize, "console", 1);
|
||||
cursor_c = -1; /* 不显示光标 */
|
||||
} else {
|
||||
key_to = 0;
|
||||
make_wtitle8(buf_win, sht_win->bxsize, "task_a", 1);
|
||||
make_wtitle8(buf_cons, sht_cons->bxsize, "console", 0);
|
||||
cursor_c = COL8_000000;
|
||||
}
|
||||
sheet_refresh(sht_win, 0, 0, sht_win->bxsize, 21);
|
||||
sheet_refresh(sht_cons, 0, 0, sht_cons->bxsize, 21);
|
||||
@@ -233,7 +235,9 @@ void HariMain(void)
|
||||
io_out8(PORT_KEYDAT, keycmd_wait);
|
||||
}
|
||||
/*重新显示光标*/
|
||||
boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
|
||||
if (cursor_c >= 0) {
|
||||
boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
|
||||
}
|
||||
sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44);
|
||||
} else if (512 <= i && i <= 767) { /* 鼠标数据*/
|
||||
if (mouse_decode(&mdec, i - 512) != 0) {
|
||||
@@ -274,14 +278,20 @@ void HariMain(void)
|
||||
} else if (i <= 1) { /* 光标用定时器*/
|
||||
if (i != 0) {
|
||||
timer_init(timer, &fifo, 0); /* 下面设定0 */
|
||||
cursor_c = COL8_000000;
|
||||
if (cursor_c >= 0) {
|
||||
cursor_c = COL8_000000;
|
||||
}
|
||||
} else {
|
||||
timer_init(timer, &fifo, 1); /* 下面设定1 */
|
||||
cursor_c = COL8_FFFFFF;
|
||||
if (cursor_c >= 0) {
|
||||
cursor_c = COL8_FFFFFF;
|
||||
}
|
||||
}
|
||||
timer_settime(timer, 50);
|
||||
boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
|
||||
sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44);
|
||||
if (cursor_c >= 0) {
|
||||
boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
|
||||
sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user