input: handle terminfo's kcbt (back tab)

This commit is contained in:
nick black 2021-08-14 02:35:21 -04:00
parent eae2295a5b
commit 437c1de952
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -145,16 +145,13 @@ input_free_esctrie(esctrie** eptr){
} }
} }
// multiple input escapes might map to the same input
static int static int
ncinputlayer_add_input_escape(ncinputlayer* nc, const char* esc, uint32_t special){ ncinputlayer_add_input_escape(ncinputlayer* nc, const char* esc, uint32_t special){
if(esc[0] != NCKEY_ESC || strlen(esc) < 2){ // assume ESC prefix + content if(esc[0] != NCKEY_ESC || strlen(esc) < 2){ // assume ESC prefix + content
logerror("Not an escape: %s (0x%x)\n", esc, special); logerror("Not an escape: %s (0x%x)\n", esc, special);
return -1; return -1;
} }
if(!nckey_supppuab_p(special) && special != NCKEY_CSI){
logerror("Not a supplementary-b PUA char: %u (0x%x)\n", special, special);
return -1;
}
esctrie** cur = &nc->inputescapes; esctrie** cur = &nc->inputescapes;
do{ do{
//fprintf(stderr, "ADDING: %s (%zu) for %d\n", esc, strlen(esc), special); //fprintf(stderr, "ADDING: %s (%zu) for %d\n", esc, strlen(esc), special);
@ -634,6 +631,7 @@ prep_special_keys(ncinputlayer* nc){
const char* tinfo; const char* tinfo;
uint32_t key; uint32_t key;
} keys[] = { } keys[] = {
{ .tinfo = "kcbt", .key = '\t', }, // FIXME plus shift
{ .tinfo = "kcub1", .key = NCKEY_LEFT, }, { .tinfo = "kcub1", .key = NCKEY_LEFT, },
{ .tinfo = "kcuf1", .key = NCKEY_RIGHT, }, { .tinfo = "kcuf1", .key = NCKEY_RIGHT, },
{ .tinfo = "kcuu1", .key = NCKEY_UP, }, { .tinfo = "kcuu1", .key = NCKEY_UP, },