detect ctrl+letter, prep ncinput appropriately #228

pull/265/head
nick black 5 years ago
parent 507c3e1d00
commit 1aa462385e
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

@ -311,8 +311,16 @@ handle_ncinput(notcurses* nc, ncinput* ni){
memset(ni, 0, sizeof(*ni));
}
char32_t r = handle_input(nc, ni);
// ctrl (*without* alt) + letter maps to [1..26], and is independent of shift
bool ctrl = r > 0 && r <= 26;
if(ctrl){
r += 'A' - 1;
}
if(ni){
ni->id = r;
if(ctrl){
ni->ctrl = true;
}
}
return r;
}

Loading…
Cancel
Save