aboutsummaryrefslogtreecommitdiff
path: root/termo.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-07-24 00:41:49 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-07-24 00:41:49 +0200
commit9ec09b90c9bb023bb69a6b703ce4df40d397f5e6 (patch)
tree1ebb4d9759e3307eeba0f7c2b7c245d905d751bf /termo.c
parent9b7c801c370b69bec13b7d737212cab3d70b0f11 (diff)
downloadtermo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.tar.gz
termo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.tar.xz
termo-9ec09b90c9bb023bb69a6b703ce4df40d397f5e6.zip
Make ASCII NUL imply Ctrl-Space instead of C-@
Seems mostly arbitrary.
Diffstat (limited to 'termo.c')
-rw-r--r--termo.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/termo.c b/termo.c
index 38caba2..953bc88 100644
--- a/termo.c
+++ b/termo.c
@@ -778,7 +778,15 @@ parse_multibyte (termo_t *tk, const unsigned char *bytes, size_t len,
static void
emit_codepoint (termo_t *tk, uint32_t codepoint, termo_key_t *key)
{
- if (codepoint < 0x20)
+ if (codepoint == 0)
+ {
+ // ASCII NUL = Ctrl-Space as well as Ctrl-@ but let's prefer
+ // the former to follow the behaviour of libtermkey
+ key->type = TERMO_TYPE_KEYSYM;
+ key->code.sym = TERMO_SYM_SPACE;
+ key->modifiers = TERMO_KEYMOD_CTRL;
+ }
+ else if (codepoint < 0x20)
{
// C0 range
key->code.codepoint = 0;