mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
demo_getc_nblock() call in demo_render() #509
This commit is contained in:
parent
67100dc5e9
commit
10643980fa
@ -420,6 +420,7 @@ int demo_nanosleep(struct notcurses* nc, const struct timespec *ts){
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FIXME needs to pass back any ncinput read, if requested...hrmmm
|
||||
int demo_render(struct notcurses* nc){
|
||||
if(interrupted){
|
||||
return 1;
|
||||
@ -450,5 +451,15 @@ int demo_render(struct notcurses* nc){
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return notcurses_render(nc);
|
||||
ncinput ni;
|
||||
char32_t id;
|
||||
id = demo_getc_nblock(nc, &ni);
|
||||
int ret = notcurses_render(nc);
|
||||
if(ret){
|
||||
return ret;
|
||||
}
|
||||
if(id == 'q'){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user