mirror of
https://github.com/limine-bootloader/limine
synced 2025-01-05 20:34:33 +03:00
menu: Add support for home and end bindings in textbox
This commit is contained in:
parent
1f0636bcb7
commit
57360b15e7
BIN
limine-pxe.bin
BIN
limine-pxe.bin
Binary file not shown.
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
BIN
stage2.map
BIN
stage2.map
Binary file not shown.
@ -20,6 +20,14 @@ int getchar_internal(uint32_t eax) {
|
||||
return GETCHAR_CURSOR_DOWN;
|
||||
case 0x53:
|
||||
return GETCHAR_DELETE;
|
||||
case 0x4f:
|
||||
return GETCHAR_END;
|
||||
case 0x47:
|
||||
return GETCHAR_HOME;
|
||||
case 0x49:
|
||||
return GETCHAR_PGUP;
|
||||
case 0x51:
|
||||
return GETCHAR_PGDOWN;
|
||||
}
|
||||
char c = eax & 0xff;
|
||||
switch (c) {
|
||||
|
@ -8,7 +8,11 @@
|
||||
#define GETCHAR_CURSOR_UP (-12)
|
||||
#define GETCHAR_CURSOR_DOWN (-13)
|
||||
#define GETCHAR_DELETE (-14)
|
||||
#define GETCHAR_F10 (-15)
|
||||
#define GETCHAR_END (-15)
|
||||
#define GETCHAR_HOME (-16)
|
||||
#define GETCHAR_PGUP (-17)
|
||||
#define GETCHAR_PGDOWN (-18)
|
||||
#define GETCHAR_F10 (-19)
|
||||
|
||||
int getchar(void);
|
||||
void readline(const char *orig_str, char *buf, size_t limit);
|
||||
|
@ -13,8 +13,6 @@
|
||||
#include <mm/pmm.h>
|
||||
#include <drivers/vbe.h>
|
||||
|
||||
#include <sys/cpu.h>
|
||||
|
||||
static char *menu_branding = NULL;
|
||||
|
||||
#define EDITOR_MAX_BUFFER_SIZE 4096
|
||||
@ -234,6 +232,16 @@ refresh:
|
||||
cursor_offset++;
|
||||
}
|
||||
break;
|
||||
case GETCHAR_HOME: {
|
||||
size_t displacement;
|
||||
get_line_offset(&displacement, cursor_offset, buffer);
|
||||
cursor_offset -= displacement;
|
||||
break;
|
||||
}
|
||||
case GETCHAR_END: {
|
||||
cursor_offset += get_line_length(cursor_offset, buffer);
|
||||
break;
|
||||
}
|
||||
case '\b':
|
||||
if (cursor_offset) {
|
||||
cursor_offset--;
|
||||
|
Loading…
Reference in New Issue
Block a user