~kaction/dvtm

426ff5f3766b54c899ff04650f566217747260e1 — Ross Mohn 6 years ago 573baff
Display control keys, when typed, next to Layout icon

Modified-By: Dmitry Bogatov <dvtm-v1@kaction.cc>
1 files changed, 14 insertions(+), 1 deletions(-)

M dvtm.c
M dvtm.c => dvtm.c +14 -1
@@ 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;