aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:41:44 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2011-04-01 10:41:44 +0100
commit59800c356b7737213d80bec5d0b3f0df4b69284c (patch)
tree5b9278e11676d0bc52accc5c01c25cc828a94748 /termkey.c
parent6424282c4ddb129d6987a0f8c03f3d23132b842c (diff)
downloadtermo-59800c356b7737213d80bec5d0b3f0df4b69284c.tar.gz
termo-59800c356b7737213d80bec5d0b3f0df4b69284c.tar.xz
termo-59800c356b7737213d80bec5d0b3f0df4b69284c.zip
Unicode codepoint is stored in key->code.codepoint, not code.number
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/termkey.c b/termkey.c
index b1a01ce..0900203 100644
--- a/termkey.c
+++ b/termkey.c
@@ -1082,13 +1082,13 @@ TermKeyResult termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, Ter
return res;
if(key->type != TERMKEY_TYPE_UNICODE)
return TERMKEY_RES_NONE;
- if(key->code.number < '@' || key->code.number > '_')
+ if(key->code.codepoint < '@' || key->code.codepoint > '_')
return TERMKEY_RES_NONE;
if(key->modifiers != 0)
return TERMKEY_RES_NONE;
- if(key->code.number >= 'A' && key->code.number <= 'Z')
- key->code.number += 0x20;
+ if(key->code.codepoint >= 'A' && key->code.codepoint <= 'Z')
+ key->code.codepoint += 0x20;
key->modifiers = TERMKEY_KEYMOD_CTRL;
fill_utf8(key);
return res;
@@ -1112,13 +1112,11 @@ TermKeyResult termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, Ter
str = hyphen + 1;
}
- long codepoint;
size_t nbytes;
- if(parse_utf8((unsigned char *)str, strlen(str), &codepoint, &nbytes) == TERMKEY_RES_KEY &&
+ if(parse_utf8((unsigned char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY &&
nbytes == strlen(str)) {
key->type = TERMKEY_TYPE_UNICODE;
- key->code.number = codepoint;
fill_utf8(key);
}
else if((key->code.sym = termkey_keyname2sym(tk, str)) != TERMKEY_SYM_UNKNOWN) {