From 0bfb13655c02c75b0e1cc864a81996e58cd5c7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Mon, 14 Sep 2020 15:38:49 +0200 Subject: Implement de/focus event parsing So far there is no way to set it up, I'm not sure how to go about it. --- termo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'termo.c') diff --git a/termo.c b/termo.c index d72a4f5..b39fce6 100644 --- a/termo.c +++ b/termo.c @@ -156,6 +156,9 @@ print_key (termo_t *tk, termo_key_t *key) ev, button, line, col); break; } + case TERMO_TYPE_FOCUS: + fprintf (stderr, "%s\n", key->code.focused ? "Focused" : "Defocused"); + break; case TERMO_TYPE_POSITION: { int line, col; @@ -1572,6 +1575,8 @@ termo_strfkey_generic (termo_t *tk, char *buffer, size_t len, } break; } + case TERMO_TYPE_FOCUS: + l = snprintf (buffer + pos, len - pos, "Focus(%d)", key->code.focused); case TERMO_TYPE_POSITION: l = snprintf (buffer + pos, len - pos, "Position"); break; @@ -1826,6 +1831,8 @@ termo_keycmp (termo_t *tk, return cmp; break; } + case TERMO_TYPE_FOCUS: + return key1.code.focused - key2.code.focused; case TERMO_TYPE_POSITION: { int line1, col1, line2, col2; -- cgit v1.2.3