mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
menu poc: let menu handle section shortcuts #1058
This commit is contained in:
parent
a1a4087ca7
commit
0e294626ab
@ -32,29 +32,7 @@ run_menu(struct notcurses* nc, struct ncmenu* ncm){
|
||||
notcurses_render(nc);
|
||||
while((keypress = notcurses_getc_blocking(nc, &ni)) != (char32_t)-1){
|
||||
if(!ncmenu_offer_input(ncm, &ni)){
|
||||
if(keypress == '\x1b'){
|
||||
if(ncmenu_rollup(ncm)){
|
||||
goto err;
|
||||
}
|
||||
}else if(ni.alt){
|
||||
switch(keypress){
|
||||
case 'a': case 'A': case 0x00e4:
|
||||
if(ncmenu_unroll(ncm, 0)){
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
case 'f': case 'F':
|
||||
if(ncmenu_unroll(ncm, 1)){
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
case 'h': case 'H':
|
||||
if(ncmenu_unroll(ncm, 3)){
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}else if(keypress == 'q'){
|
||||
if(keypress == 'q'){
|
||||
ncmenu_destroy(ncm);
|
||||
ncplane_destroy(selplane);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user