mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-20 03:25:47 +00:00
ncselector: implement pgup/pgdown #862
This commit is contained in:
parent
046d4a9d5d
commit
02fb9b078f
@ -436,6 +436,7 @@ const char* ncselector_nextitem(ncselector* n){
|
||||
}
|
||||
|
||||
bool ncselector_offer_input(ncselector* n, const ncinput* nc){
|
||||
const int items_shown = ncplane_dim_y(n->ncp) - 4 - (n->title ? 2 : 0);
|
||||
if(nc->id == NCKEY_UP){
|
||||
ncselector_previtem(n);
|
||||
return true;
|
||||
@ -449,10 +450,18 @@ bool ncselector_offer_input(ncselector* n, const ncinput* nc){
|
||||
ncselector_nextitem(n);
|
||||
return true;
|
||||
}else if(nc->id == NCKEY_PGDOWN){
|
||||
ncselector_nextitem(n); // FIXME should be a page's worth, or go to bottom
|
||||
if(items_shown > 0){
|
||||
for(int i = 0 ; i < items_shown ; ++i){
|
||||
ncselector_nextitem(n);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}else if(nc->id == NCKEY_PGUP){
|
||||
ncselector_previtem(n); // FIXME should be a page's worth, or go to top
|
||||
if(items_shown > 0){
|
||||
for(int i = 0 ; i < items_shown ; ++i){
|
||||
ncselector_previtem(n);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}else if(nc->id == NCKEY_RELEASE){
|
||||
int y = nc->y, x = nc->x;
|
||||
|
Loading…
Reference in New Issue
Block a user