mirror of
https://github.com/fltk/fltk.git
synced 2026-05-22 15:22:34 +08:00
Fix button down state when triggered by shortcut (#1145)
The visual feedback is really important. I was not aware that my patch suppressed that. And for the state values, I find it best to get back to what 1.3 did at this point. `value` is essential for check boxes and radio and toggle buttons. On push buttons, it has really not much of a meaning.
This commit is contained in:
@@ -192,17 +192,14 @@ int Fl_Button::handle(int event) {
|
||||
do_callback(FL_REASON_RELEASED);
|
||||
} else {
|
||||
simulate_key_action();
|
||||
value(1);
|
||||
if (when() & FL_WHEN_CHANGED) {
|
||||
set_changed();
|
||||
Fl_Widget_Tracker wp(this);
|
||||
do_callback(FL_REASON_CHANGED);
|
||||
if (wp.deleted()) return 1;
|
||||
value(0);
|
||||
set_changed();
|
||||
do_callback(FL_REASON_RELEASED);
|
||||
} else if (when() & FL_WHEN_RELEASE) {
|
||||
value(0);
|
||||
set_changed();
|
||||
do_callback(FL_REASON_RELEASED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user