aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-02-10 15:28:07 +0000
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2008-02-10 15:28:07 +0000
commit1e9eb3719a9a265720aee5e3c60858c4183e6327 (patch)
treeecd955e667c997911c8b713e3be38ac7f89d24d9 /termkey.c
parentdaed589b5c2c0935787754ff3402aca68a820802 (diff)
downloadtermo-1e9eb3719a9a265720aee5e3c60858c4183e6327.tar.gz
termo-1e9eb3719a9a265720aee5e3c60858c4183e6327.tar.xz
termo-1e9eb3719a9a265720aee5e3c60858c4183e6327.zip
Interpret 8bit SS3/CSI codes and remaining C1s as C-A-letter
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/termkey.c b/termkey.c
index e0113af..ed8191d 100644
--- a/termkey.c
+++ b/termkey.c
@@ -394,9 +394,24 @@ termkey_result termkey_getkey(termkey_t *tk, termkey_key *key)
return TERMKEY_RES_KEY;
}
+ else if(b0 == 0x8f) {
+ return getkey_ss3(tk, 1, key);
+ }
+ else if(b0 == 0x9b) {
+ return getkey_csi(tk, 1, key);
+ }
else if(b0 >= 0x80 && b0 < 0xa0) {
- // TODO - C1 or UTF-8?
- fprintf(stderr, "TODO - b0 is 0x%02x - Might be C1, might be UTF-8\n", b0);
+ // UTF-8 never starts with a C1 byte. So we can be sure of these
+ key->code = b0 - 0x40;
+ key->modifiers = TERMKEY_KEYMOD_CTRL|TERMKEY_KEYMOD_ALT;
+ key->flags = 0;
+
+ key->utf8[0] = key->code;
+ key->utf8[1] = 0;
+
+ eatbytes(tk, 1);
+
+ return TERMKEY_RES_KEY;
}
else if(tk->flags & TERMKEY_FLAG_UTF8) {
// Some UTF-8