mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-29 14:16:22 +00:00
Implemented DEL key on input
This commit is contained in:
13
input_win.c
13
input_win.c
@@ -176,6 +176,19 @@ static int _handle_edit(const int ch, char *input, int *size)
|
|||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
case KEY_DC: // DEL
|
||||||
|
if (inp_x <= *size) {
|
||||||
|
wdelch(inp_win);
|
||||||
|
|
||||||
|
// if not last char, shift chars left
|
||||||
|
if (inp_x < *size)
|
||||||
|
for (i = inp_x-1; i < *size; i++)
|
||||||
|
input[i] = input[i+1];
|
||||||
|
|
||||||
|
(*size)--;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
|
||||||
case KEY_LEFT:
|
case KEY_LEFT:
|
||||||
if (inp_x > 1)
|
if (inp_x > 1)
|
||||||
wmove(inp_win, inp_y, inp_x-1);
|
wmove(inp_win, inp_y, inp_x-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user