From 426ff5f3766b54c899ff04650f566217747260e1 Mon Sep 17 00:00:00 2001 From: Ross Mohn Date: Fri, 12 Aug 2016 11:22:02 -0400 Subject: [PATCH] Display control keys, when typed, next to Layout icon Modified-By: Dmitry Bogatov --- dvtm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dvtm.c b/dvtm.c index 58d15a2..0b73234 100644 --- a/dvtm.c +++ b/dvtm.c @@ -228,6 +228,7 @@ extern Screen screen; static unsigned int waw, wah, wax, way; static Client *clients = NULL; static char *title; +static KeyCombo keys; #include "config.h" @@ -354,6 +355,16 @@ drawbar(void) { addstr(layout->symbol); attrset(TAG_NORMAL); + if (keys) { + unsigned int keycount = 0; + while (keycount < MAX_KEYS && keys[keycount]) { + if (keys[keycount] < ' ') + printw("^%c", 'A' - 1 + keys[keycount++]); + else + printw("%c", keys[keycount++]); + } + } + getyx(stdscr, y, x); (void)y; int maxwidth = screen.w - x - 2; @@ -1815,7 +1826,6 @@ parse_args(int argc, char *argv[]) { int main(int argc, char *argv[]) { - KeyCombo keys; unsigned int key_index = 0; memset(keys, 0, sizeof(keys)); sigset_t emptyset, blockset; @@ -1901,6 +1911,9 @@ main(int argc, char *argv[]) { memset(keys, 0, sizeof(keys)); keypress(code); } + drawbar(); + if (is_content_visible(sel)) + wnoutrefresh(sel->window); } if (r == 1) /* no data available on pty's */ continue; -- 2.38.5