diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-11-05 22:10:24 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-11-05 22:19:03 +0100 |
| commit | f3b490134e511730d0d9f1c1ab78d57b4de11006 (patch) | |
| tree | 8bdc883b81ace092b0ebc631c9255b573dd93d43 /src/Fl_Input.cxx | |
| parent | 1f5472a7d37af7909c1daa37bb5aee7296df170a (diff) | |
Fixes text input widget undo propagation.
If not handled, undo propagates to other random widgets,
and if none takes it, it is resent as a redo to all widgets.
Diffstat (limited to 'src/Fl_Input.cxx')
| -rw-r--r-- | src/Fl_Input.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 88ea49cc3..4bd799e62 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -440,8 +440,14 @@ int Fl_Input::handle_key() { if (mods==FL_COMMAND) return kf_copy_cut(); // Ctrl-X, Mac:Meta-X (Standard/OSX-HIG) break; case 'z': - if (mods==FL_COMMAND && !shift) return kf_undo(); // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) - if (mods==FL_COMMAND && shift) return kf_redo(); // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) + if (mods==FL_COMMAND && !shift) { // Ctrl-Z, Mac:Meta-Z (Standard/OSX-HIG) + if (!kf_undo()) fl_beep(); + return 1; + } + if (mods==FL_COMMAND && shift) { // Shift-Ctrl-Z, Mac:Shift-Meta-Z (Standard/OSX-HIG) + if (!kf_redo()) fl_beep(); + return 1; + } break; // handle other combos elsewhere } |
