~martanne/dvtm

2f565f26d569a57eb829a13d59bf91af40e27e09 — Ross Mohn 7 years ago 7443f67
Display control keys, when typed, next to Layout icon

Close #28
1 files changed, 11 insertions(+), 1 deletions(-)

M dvtm.c
M dvtm.c => dvtm.c +11 -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,13 @@ drawbar(void) {
	addstr(layout->symbol);
	attrset(TAG_NORMAL);

	for (unsigned int i = 0; i < MAX_KEYS && keys[i]; i++) {
		if (keys[i] < ' ')
			printw("^%c", 'A' - 1 + keys[i]);
		else
			printw("%c", keys[i]);
	}

	getyx(stdscr, y, x);
	(void)y;
	int maxwidth = screen.w - x - 2;


@@ 1815,7 1823,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 1908,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;