diff options
-rw-r--r-- | src/ui/console.c | 2 | ||||
-rw-r--r-- | src/ui/inputwin.c | 21 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c index 17e97ca3..192edfc4 100644 --- a/src/ui/console.c +++ b/src/ui/console.c @@ -1289,6 +1289,8 @@ cons_navigation_help(void) cons_show(""); cons_show("Alt-1 : This console window."); cons_show("Alt-2..Alt-0 : Chat windows."); + cons_show("Alt-LEFT : Previous chat window"); + cons_show("Alt-RIGHT : Next chat window"); cons_show("F1 : This console window."); cons_show("F2..F10 : Chat windows."); cons_show("UP, DOWN : Navigate input history."); diff --git a/src/ui/inputwin.c b/src/ui/inputwin.c index 598911cd..dc8e994a 100644 --- a/src/ui/inputwin.c +++ b/src/ui/inputwin.c @@ -40,6 +40,7 @@ #include "log.h" #include "profanity.h" #include "ui/ui.h" +#include "ui/windows.h" #include "xmpp/xmpp.h" #define _inp_win_refresh() prefresh(inp_win, 0, pad_start, rows-1, 0, rows-1, cols-1) @@ -559,6 +560,8 @@ _handle_alt_key(char *input, int *size, int key) { int end_del = getcurx(inp_win); int start_del = end_del; + int current = wins_get_current_num(); + int new; switch (key) { @@ -592,6 +595,24 @@ _handle_alt_key(char *input, int *size, int key) case '0': ui_switch_win(0); break; + case KEY_LEFT: + if (current == 0) { + new = 9; + } else { + new = current - 1; + } + + ui_switch_win(new); + break; + case KEY_RIGHT: + if (current == 9) { + new = 0; + } else { + new = current + 1; + } + + ui_switch_win(new); + break; case 263: case 127: input[*size] = '\0'; |