consider kitty keyboard events PRESS by default

Whenever we get a keyboard event while using the Kitty
keyboard protocol (used by kitty and foot), unless there
is an explicit evtype provided, assume it to be a press.
We already did this for kitty-only types, but we need do
it for all possible inputs. Closes #2578.
pull/2580/head
nick black 2 years ago
parent b7bab3ca6d
commit 47c42cf172
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -108,7 +108,8 @@ typedef struct inputctx {
// been taken, both become NULL.
struct initial_responses* initdata;
struct initial_responses* initdata_complete;
bool failed; // error initializing input automaton, abort
int kittykbd; // kitty keyboard protocol support level
bool failed; // error initializing input automaton, abort
} inputctx;
static inline void
@ -495,6 +496,13 @@ load_ncinput(inputctx* ictx, ncinput *tni){
}
}
}
// if the kitty keyboard protocol is in use, any input without an explicit
// evtype can be safely considered a PRESS.
if(ictx->kittykbd){
if(tni->evtype == NCTYPE_UNKNOWN){
tni->evtype = NCTYPE_PRESS;
}
}
if(tni->modifiers == NCKEY_MOD_CTRL){ // exclude all other modifiers
if(ictx->linesigs){
if(tni->id == 'C'){
@ -1068,7 +1076,8 @@ kitty_keyboard_cb(inputctx* ictx){
if(ictx->initdata){
ictx->initdata->kbdlevel = level;
}
loginfo("kitty keyboard protocol level %u", level);
loginfo("kitty keyboard level %u (was %u)", level, ictx->kittykbd);
ictx->kittykbd = level;
return 2;
}

Loading…
Cancel
Save