diff options
author | corvid <corvid@lavabit.com> | 2011-09-25 20:11:35 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-09-25 20:11:35 +0000 |
commit | c30e88ff95eb09b4fc6a2939d62d51ae3f0ef708 (patch) | |
tree | 2433f7435bdd32a61bbb33afd4dbe7bfce3bae35 /dw/fltkcomplexbutton.cc | |
parent | f5c87d5d8f0bea64c867c42f994225a59b0c42be (diff) |
let the enter key trigger buttons when possible
Topic brought up by Alexander recently. In FLTK2, Enter and Space would
both trigger buttons. In 1.3, only Space does it. I asked the FLTK guys
about this, and I learned that Space to trigger buttons is actually
old-school X behaviour that I somehow never became aware of.
Diffstat (limited to 'dw/fltkcomplexbutton.cc')
-rw-r--r-- | dw/fltkcomplexbutton.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dw/fltkcomplexbutton.cc b/dw/fltkcomplexbutton.cc index 89295190..8f847218 100644 --- a/dw/fltkcomplexbutton.cc +++ b/dw/fltkcomplexbutton.cc @@ -108,7 +108,8 @@ int ComplexButton::handle(int event) { return 1; } else return 0; case FL_KEYBOARD : - if (Fl::focus() == this && Fl::event_key() == ' ' && + if (Fl::focus() == this && + (Fl::event_key() == ' ' || Fl::event_key() == FL_Enter) && !(Fl::event_state() & (FL_SHIFT | FL_CTRL | FL_ALT | FL_META))) { set_changed(); Fl_Widget_Tracker wp(this); |