ncplayer: handle ctrl-L for redraw

This commit is contained in:
nick black 2021-02-27 18:20:15 -05:00 committed by Nick Black
parent 44826194e7
commit 2437e6c89c

View File

@ -140,6 +140,9 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
} }
if(keyp == NCKey::Resize){ if(keyp == NCKey::Resize){
return 0; return 0;
}else if(keyp == 'L'){ // FIXME check for ctrl+l
nc.refresh(nullptr, nullptr);
continue;
}else if(keyp >= '0' && keyp <= '8'){ // FIXME eliminate ctrl/alt }else if(keyp >= '0' && keyp <= '8'){ // FIXME eliminate ctrl/alt
marsh->blitter = static_cast<ncblitter_e>(keyp - '0'); marsh->blitter = static_cast<ncblitter_e>(keyp - '0');
vopts->blitter = marsh->blitter; vopts->blitter = marsh->blitter;
@ -381,6 +384,9 @@ auto main(int argc, char** argv) -> int {
break; break;
}else if(ie == 'q'){ }else if(ie == 'q'){
goto done; goto done;
}else if(ie == 'L'){
--i;
nc.refresh(nullptr, nullptr);
}else if(ie >= '0' && ie <= '8'){ }else if(ie >= '0' && ie <= '8'){
--i; // rerun same input with the new blitter --i; // rerun same input with the new blitter
vopts.blitter = blitter = static_cast<ncblitter_e>(ie - '0'); vopts.blitter = blitter = static_cast<ncblitter_e>(ie - '0');