demo: handle remaining menu inputs

This commit is contained in:
nick black 2020-02-10 00:38:34 -05:00
parent d3c26320ef
commit ab8417e488
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -65,11 +65,22 @@ bool menu_or_hud_key(const struct ncinput *ni){
if(!menu){ if(!menu){
return false; return false;
} }
if((ni->id == 'o' || ni->id == 'O') && ni->alt && !ni->ctrl){ if(ni->id == 'o' && ni->alt && !ni->ctrl){
if(ncmenu_unroll(menu, 0) == 0){ if(ncmenu_unroll(menu, 0) == 0){
menu_unrolled = true; menu_unrolled = true;
} }
return true; return true;
}else if(ni->id == 'h' && ni->alt && !ni->ctrl){
if(ncmenu_unroll(menu, 2) == 0){
menu_unrolled = true;
}
return true;
}else if(ni->id == '\x1b'){
if(menu_unrolled){
ncmenu_rollup(menu);
menu_unrolled = false;
return true;
}
}else if(ni->id == NCKEY_UP){ }else if(ni->id == NCKEY_UP){
if(!menu_unrolled){ if(!menu_unrolled){
return false; return false;