Skip to content

Commit

Permalink
大写字母与小写字母
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed Apr 26, 2016
1 parent 5c04044 commit 2b66917
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 17_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void HariMain(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
};
int key_to = 0, key_shift = 0;
int key_to = 0, key_shift = 0, key_leds = (binfo->leds >> 4) & 7;

init_gdtidt();
init_pic();
Expand Down Expand Up @@ -144,6 +144,11 @@ void HariMain(void)
} else {
s[0] = 0;
}
if ('A' <= s[0] && s[0] <= 'Z') { /*当输入字符为英文字母时*/
if (((key_leds & 4) == 0 && key_shift == 0) ||((key_leds & 4) != 0 && key_shift != 0)) {
s[0] += 0x20; /*将大写字母转换为小写字母*/
}
}
if (s[0] != 0) { /*一般字符*/
if (key_to == 0) { /*发送给任务A */
if (cursor_x < 128) {
Expand Down

0 comments on commit 2b66917

Please sign in to comment.