[ncplayer] restore pause functionality with NCTYPE_RELEASE

pull/2280/head
nick black 3 years ago
parent 1e1d1bb631
commit ec67847806
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -112,17 +112,18 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
continue; continue;
} }
if(keyp == ' '){ if(keyp == ' '){
if((keyp = nc.get(true)) == (uint32_t)-1){ do{
if((keyp = nc.get(true, &ni)) == (uint32_t)-1){
ncplane_destroy(subp); ncplane_destroy(subp);
return -1; return -1;
} }
}while(ni.id != 'q' && (ni.evtype == EvType::Release || ni.id != ' '));
} }
// if we just hit a non-space character to unpause, ignore it // if we just hit a non-space character to unpause, ignore it
if(keyp == ' '){ // space for unpause
continue;
}
if(keyp == NCKey::Resize){ if(keyp == NCKey::Resize){
return 0; return 0;
}else if(keyp == ' '){ // space for unpause
continue;
}else if(keyp == 'L' && ni.ctrl && !ni.alt){ }else if(keyp == 'L' && ni.ctrl && !ni.alt){
nc.refresh(nullptr, nullptr); nc.refresh(nullptr, nullptr);
continue; continue;
@ -144,6 +145,8 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts,
}else if(keyp == NCKey::Left){ }else if(keyp == NCKey::Left){
// FIXME move backwards // FIXME move backwards
continue; continue;
}else if(keyp != 'q'){
continue;
} }
ncplane_destroy(subp); ncplane_destroy(subp);
return 1; return 1;

Loading…
Cancel
Save