mirror of
https://github.com/limine-bootloader/limine
synced 2025-01-11 15:19:29 +03:00
readline: Support delete key
This commit is contained in:
parent
530b4a8f3b
commit
1de574944a
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
@ -197,6 +197,8 @@ int getchar_internal(uint32_t eax) {
|
||||
return GETCHAR_CURSOR_UP;
|
||||
case 0x50:
|
||||
return GETCHAR_CURSOR_DOWN;
|
||||
case 0x53:
|
||||
return GETCHAR_DELETE;
|
||||
}
|
||||
return (char)(eax & 0xff);
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ int pit_sleep_and_quit_on_keypress(uint32_t pit_ticks);
|
||||
#define GETCHAR_CURSOR_RIGHT (-11)
|
||||
#define GETCHAR_CURSOR_UP (-12)
|
||||
#define GETCHAR_CURSOR_DOWN (-13)
|
||||
#define GETCHAR_DELETE (-14)
|
||||
|
||||
int getchar(void);
|
||||
uint64_t strtoui(const char *s);
|
||||
|
@ -68,6 +68,7 @@ void readline(const char *orig_str, char *buf, size_t limit) {
|
||||
if (i) {
|
||||
i--;
|
||||
cursor_back();
|
||||
case GETCHAR_DELETE:;
|
||||
size_t j;
|
||||
for (j = i; ; j++) {
|
||||
buf[j] = buf[j+1];
|
||||
|
Loading…
Reference in New Issue
Block a user