On 2015-11-06 at 23:23:24 +0100, Vadim Kochan <vadi...@gmail.com> wrote: [...] > +static void draw_help(WINDOW *screen) > +{ > + int col = 0; > + int row = 0; > + int i; > + > + mvaddch(row, col, ACS_ULCORNER); > + mvaddch(rows - row - 2, col, ACS_LLCORNER); > + > + mvaddch(row, cols - 1, ACS_URCORNER); > + mvaddch(rows - row - 2, cols - col - 1, ACS_LRCORNER); > + > + for (i = 1; i < rows - row - 2; i++) { > + mvaddch(row + i, 0, ACS_VLINE); > + mvaddch(row + i, cols - col - 1, ACS_VLINE); > + } > + for (i = 1; i < cols - col - 1; i++) { > + mvaddch(0, col + i, ACS_HLINE); > + mvaddch(rows - row - 2, col + i, ACS_HLINE); > + } > + > + attron(A_BOLD); > + mvaddnstr(row, cols / 2 - 2, "| Help |", -1); > + > + attron(A_UNDERLINE); > + mvaddnstr(row + 2, col + 2, "Navigation", -1); > + attroff(A_BOLD | A_UNDERLINE); > + > + mvaddnstr(row + 4, col + 3, "Up, u, k Move up", -1); > + mvaddnstr(row + 5, col + 3, "Down, d, j Move down", -1); > + mvaddnstr(row + 6, col + 3, "ESC Close window", -1); > + mvaddnstr(row + 7, col + 3, "? Show 'Help'", -1);
I changed this to "Toggle help window", see below. > + mvaddnstr(row + 8, col + 3, "q, Ctrl+C Quit", -1); > +} [...] > @@ -1192,22 +1239,46 @@ static void presenter(void) > if (skip_lines > SCROLL_MAX) > skip_lines = SCROLL_MAX; > break; > + case '?': > + if (show_help) > + show_help = false; > + else > + show_help = true; > + > + wclear(screen); > + clear(); > + break; > + case 27: /* ESC */ > + show_help = false; > + wclear(screen); > + clear(); > + break; I don't think we need an extra command for this. Using '?' to toggle the help window should be sufficient. I removed the command, adjusted the help text and applied the patch. Thanks! -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.