diff options
-rw-r--r-- | dw/fltkui.cc | 7 | ||||
-rw-r--r-- | src/dialog.cc | 6 |
2 files changed, 8 insertions, 5 deletions
diff --git a/dw/fltkui.cc b/dw/fltkui.cc index c25fbf7a..f5a2339b 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -107,8 +107,11 @@ int CustChoice::handle(int e) this, e, active(), (Fl::focus() == this)); if (Fl::focus() != this) { ; // Not Focused, let FLTK handle it - } else if (e == FL_KEYDOWN) { - if (modifier == 0 && isalnum(k)) { + } else if (e == FL_KEYDOWN && modifier == 0) { + if (k == FL_Enter || k == FL_Down) { + return Fl_Choice::handle(FL_PUSH); // activate menu + + } else if (isalnum(k)) { // try key as shortcut to menuitem int t = value()+1 >= size() ? 0 : value()+1; while (t != value()) { const Fl_Menu_Item *mi = &(menu()[t]); diff --git a/src/dialog.cc b/src/dialog.cc index 484eebc4..92b99041 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -82,9 +82,9 @@ int CustInput3::handle(int e) /* * Used to make the ENTER key activate the CustChoice */ -class CustChoice : public Fl_Choice { +class CustChoice2 : public Fl_Choice { public: - CustChoice (int x, int y, int w, int h, const char* l=0) : + CustChoice2 (int x, int y, int w, int h, const char* l=0) : Fl_Choice(x,y,w,h,l) {}; int handle(int e) { if (e == FL_KEYBOARD && @@ -178,7 +178,7 @@ const char *a_Dialog_input(const char *title, const char *msg) c_inp->labelsize(14); c_inp->textsize(14); - CustChoice *ch = new CustChoice(1*gap,ih+3*gap,180,24); + CustChoice2 *ch = new CustChoice2(1*gap,ih+3*gap,180,24); if (!pm) { int n_it = dList_length(prefs.search_urls); pm = new Fl_Menu_Item[n_it+1]; |