aboutsummaryrefslogtreecommitdiff
path: root/termo.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-09-14 15:38:49 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-09-14 17:55:41 +0200
commit0bfb13655c02c75b0e1cc864a81996e58cd5c7b4 (patch)
treebce0c60337beda47d632511f0f4e0afd9bb7eb17 /termo.c
parent78c0cd443d7e302fac6448db9d776c02a185d084 (diff)
downloadtermo-0bfb13655c02c75b0e1cc864a81996e58cd5c7b4.tar.gz
termo-0bfb13655c02c75b0e1cc864a81996e58cd5c7b4.tar.xz
termo-0bfb13655c02c75b0e1cc864a81996e58cd5c7b4.zip
Implement de/focus event parsing
So far there is no way to set it up, I'm not sure how to go about it.
Diffstat (limited to 'termo.c')
-rw-r--r--termo.c7
1 files changed, 7 insertions, 0 deletions
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;