Skip to content

Commit

Permalink
always add windows special keys #2131
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Sep 4, 2021
1 parent 2910a59 commit bc3c2cf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ ncinputlayer_add_input_escape(ncinputlayer* nc, const char* esc, uint32_t specia
// it appears that multiple keys can be mapped to the same escape string. as
// an example, see "kend" and "kc1" in st ("simple term" from suckless) :/.
if((*cur)->special != NCKEY_INVALID){ // already had one here!
logwarn("already added escape (got 0x%x, wanted 0x%x)\n", (*cur)->special, special);
if((*cur)->special != special){
logwarn("already added escape (got 0x%x, wanted 0x%x)\n", (*cur)->special, special);
}
}else{
(*cur)->special = special;
(*cur)->shift = shift;
Expand Down Expand Up @@ -1683,12 +1685,12 @@ int ncinputlayer_init(tinfo* tcache, FILE* infp, queried_terminals_e* detected,
nilayer->infd = fileno(infp);
loginfo("input fd: %d\n", nilayer->infd);
nilayer->ttyfd = tty_check(nilayer->infd) ? -1 : get_tty_fd(infp);
if(*detected == TERMINAL_MSTERMINAL){
if(prep_windows_special_keys(nilayer)){
return -1;
}
if(prep_windows_special_keys(nilayer)){
pthread_mutex_destroy(&nilayer->lock);
return -1;
}
if(prep_special_keys(nilayer)){
input_free_esctrie(&nilayer->inputescapes);
pthread_mutex_destroy(&nilayer->lock);
return -1;
}
Expand Down

0 comments on commit bc3c2cf

Please sign in to comment.