Added better support for home/end
This commit is contained in:
parent
8e5b1497fa
commit
00653d0b11
4
ask.c
4
ask.c
@ -236,10 +236,10 @@ static char *get_input(FILE *in, FILE *out, const char *prompt, const char *init
|
|||||||
buf = NULL;
|
buf = NULL;
|
||||||
picked = NULL;
|
picked = NULL;
|
||||||
goto finished;
|
goto finished;
|
||||||
case KEY_CTRL_A:
|
case KEY_CTRL_A: case KEY_HOME:
|
||||||
b = 0;
|
b = 0;
|
||||||
break;
|
break;
|
||||||
case KEY_CTRL_E:
|
case KEY_CTRL_E: case KEY_END:
|
||||||
b = len;
|
b = len;
|
||||||
break;
|
break;
|
||||||
case KEY_CTRL_U: {
|
case KEY_CTRL_U: {
|
||||||
|
1
bterm.h
1
bterm.h
@ -162,6 +162,7 @@ int bgetkey(FILE *in, int *mouse_x, int *mouse_y, int timeout)
|
|||||||
case '~':
|
case '~':
|
||||||
switch (numcode) {
|
switch (numcode) {
|
||||||
case 3: return KEY_DELETE;
|
case 3: return KEY_DELETE;
|
||||||
|
case 4: return KEY_END;
|
||||||
case 5: return KEY_PGUP;
|
case 5: return KEY_PGUP;
|
||||||
case 6: return KEY_PGDN;
|
case 6: return KEY_PGDN;
|
||||||
case 15: return KEY_F5;
|
case 15: return KEY_F5;
|
||||||
|
Loading…
Reference in New Issue
Block a user