mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
[cli1] properly loop on NCTYPE_RELEASE
This commit is contained in:
parent
0836f02864
commit
3eb2383fff
@ -502,6 +502,8 @@ int main(int argc, const char** argv){
|
||||
notcurses_stop(nc);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
ncplane_set_fg_alpha(stdn, NCALPHA_HIGHCONTRAST);
|
||||
ncplane_set_fg_rgb(stdn, 0xffffff);
|
||||
ncplane_set_scrolling(stdn, true);
|
||||
tinfo_debug_caps(stdn, &nc->tcache, indent);
|
||||
tinfo_debug_styles(nc, stdn, indent);
|
||||
|
@ -17,23 +17,25 @@ int main(void){
|
||||
ncplane_set_scrolling(stdn, true);
|
||||
ncinput ni;
|
||||
do{
|
||||
if(ncplane_putstr(stdn, "press any key\n") < 0){
|
||||
if(ncplane_putstr(stdn, "press any key, q to quit\n") < 0){
|
||||
goto err;
|
||||
}
|
||||
if(notcurses_render(nc)){
|
||||
goto err;
|
||||
}
|
||||
// just some pointless testing of notcurses_inputready_fd() here
|
||||
do{
|
||||
// just some pointless testing of notcurses_inputready_fd() here
|
||||
#ifndef __MINGW32__
|
||||
struct pollfd pfd = {
|
||||
.fd = notcurses_inputready_fd(nc),
|
||||
.events = POLLIN,
|
||||
};
|
||||
while(poll(&pfd, 1, -1) <= 0){
|
||||
}
|
||||
struct pollfd pfd = {
|
||||
.fd = notcurses_inputready_fd(nc),
|
||||
.events = POLLIN,
|
||||
};
|
||||
while(poll(&pfd, 1, -1) <= 0){
|
||||
}
|
||||
#endif
|
||||
notcurses_get_blocking(nc, &ni);
|
||||
}while(ni.evtype == NCTYPE_RELEASE || ni.id != 'q');
|
||||
notcurses_get_blocking(nc, &ni);
|
||||
}while(ni.evtype == NCTYPE_RELEASE);
|
||||
}while(ni.id != 'q');
|
||||
if(notcurses_render(nc)){
|
||||
goto err;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user