Skip to content
Snippets Groups Projects
Commit bda0c79d authored by deuce's avatar deuce
Browse files

Up/Down arrows wrap the menu top to bottom.

ENTER key in input box selects Ok button.
parent d5323f63
No related branches found
No related tags found
No related merge requests found
......@@ -378,6 +378,24 @@ int UIFC_Button::handle(int event) {
parent()->child(i)->handle(FL_FOCUS);
return(1);
}
if(key==FL_Up) {
for(i=0;i<parent()->children() && this!=parent()->child(i);i++) {}
i=i-1;
if(i<0)
i=parent()->children()-3;
Fl::focus(parent()->child(i));
parent()->child(i)->handle(FL_FOCUS);
return(1);
}
if(key==FL_Down) {
for(i=0;i<parent()->children() && this!=parent()->child(i);i++) {}
i=i+1;
if(i>parent()->children()-3)
i=0;
Fl::focus(parent()->child(i));
parent()->child(i)->handle(FL_FOCUS);
return(1);
}
}
return Fl_Button::handle(event);
}
......@@ -489,6 +507,10 @@ int UIFC_Input_Box::handle_key() {
case FL_BackSpace:
ascii = ctrl('H');
break;
case FL_Enter:
case FL_KP_Enter:
GUI_RetVal=0;
return 1;
}
int i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment