mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
Windows: use ENABLE_VIRTUAL_TERMINAL_INPUT
This commit is contained in:
parent
e384f4021c
commit
e49f0eadf1
@ -1590,7 +1590,20 @@ int ncinputlayer_init(tinfo* tcache, FILE* infp, queried_terminals_e* detected,
|
||||
nilayer->user_wants_data = false;
|
||||
nilayer->inner_wants_data = false;
|
||||
pthread_cond_init(&nilayer->creport_cond, NULL);
|
||||
#ifndef __MINGW64__
|
||||
#ifdef __MINGW64__
|
||||
HANDLE in = GetStdHandle(STD_INPUT_HANDLE);
|
||||
if(in == INVALID_HANDLE_VALUE){
|
||||
logerror("couldn't get input handle\n");
|
||||
return -1;
|
||||
}
|
||||
if(!SetConsoleMode(in, ENABLE_MOUSE_INPUT
|
||||
| ENABLE_VIRTUAL_TERMINAL_INPUT
|
||||
| ENABLE_PROCESSED_INPUT
|
||||
| ENABLE_WINDOW_INPUT)){
|
||||
logerror("couldn't set input console mode\n");
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
// widnows terminal doesn't seem to reply to any queries =/
|
||||
int csifd = nilayer->ttyfd >= 0 ? nilayer->ttyfd : nilayer->infd;
|
||||
if(isatty(csifd)){
|
||||
@ -1630,18 +1643,6 @@ int ncinputlayer_init(tinfo* tcache, FILE* infp, queried_terminals_e* detected,
|
||||
*kittygraphs = true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
HANDLE in = GetStdHandle(STD_INPUT_HANDLE);
|
||||
if(in == INVALID_HANDLE_VALUE){
|
||||
logerror("couldn't get input handle\n");
|
||||
return -1;
|
||||
}
|
||||
if(!SetConsoleMode(in, ENABLE_MOUSE_INPUT
|
||||
| ENABLE_PROCESSED_INPUT
|
||||
| ENABLE_WINDOW_INPUT)){
|
||||
logerror("couldn't set input console mode\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user