[kbd] escape keys
This commit is contained in:
parent
29ec9cce80
commit
a633c34e39
@ -98,8 +98,12 @@ void norm(int scancode) {
|
||||
if (keyboard_state.shift) {
|
||||
putch(kbd_us_l2[scancode]);
|
||||
} else if (keyboard_state.ctrl) {
|
||||
putch('^');
|
||||
putch(kbd_us_l2[scancode]);
|
||||
int out = (int)(kbd_us_l2[scancode] - 0x40);
|
||||
if (out < 0 || out > 0x1F) {
|
||||
putch(kbd_us[scancode]);
|
||||
} else {
|
||||
putch((char)out);
|
||||
}
|
||||
} else {
|
||||
putch(kbd_us[scancode]);
|
||||
}
|
||||
|
@ -108,6 +108,7 @@ char * kgets_buffer = NULL;
|
||||
int kgets_collected = 0;
|
||||
int kgets_want = 0;
|
||||
int kgets_newline = 0;
|
||||
int kgets_cancel = 0;
|
||||
|
||||
void
|
||||
kgets_handler(
|
||||
@ -128,6 +129,10 @@ kgets_handler(
|
||||
kgets_newline = 1;
|
||||
writech('\n');
|
||||
return;
|
||||
} else if (ch < 0x20) {
|
||||
writech('^');
|
||||
writech(ch + 0x40);
|
||||
return;
|
||||
} else {
|
||||
writech(ch);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user