diff options
Diffstat (limited to 'input_win.c')
-rw-r--r-- | input_win.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/input_win.c b/input_win.c index 34a67ac5..8cd1c3cd 100644 --- a/input_win.c +++ b/input_win.c @@ -87,29 +87,34 @@ void inp_get_char(int *ch, char *input, int *size) noecho(); *ch = wgetch(inp_win); - // if it wasn't an arrow key etc - if (!_handle_edit(*ch, input, size)) { - if (_printable(*ch)) { - getyx(inp_win, inp_y, inp_x); - - // handle insert if not at end of input - if (inp_x <= *size) { - winsch(inp_win, *ch); - wmove(inp_win, inp_y, inp_x+1); - - for (i = *size; i > inp_x -1; i--) - input[i] = input[i-1]; - input[inp_x -1] = *ch; - - (*size)++; - - // otherwise just append - } else { - waddch(inp_win, *ch); - input[(*size)++] = *ch; + if (*ch == KEY_RESIZE) { + cons_show("REZISE SIGNAL"); + win_resize(); + } else { + // if it wasn't an arrow key etc + if (!_handle_edit(*ch, input, size)) { + if (_printable(*ch)) { + getyx(inp_win, inp_y, inp_x); + + // handle insert if not at end of input + if (inp_x <= *size) { + winsch(inp_win, *ch); + wmove(inp_win, inp_y, inp_x+1); + + for (i = *size; i > inp_x -1; i--) + input[i] = input[i-1]; + input[inp_x -1] = *ch; + + (*size)++; + + // otherwise just append + } else { + waddch(inp_win, *ch); + input[(*size)++] = *ch; + } + + reset_search_attempts(); } - - reset_search_attempts(); } } |