summaryrefslogtreecommitdiff
path: root/src/Fl_Shortcut_Button.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-12-08 15:09:32 +0100
committerMatthias Melcher <github@matthiasm.com>2023-12-08 15:09:42 +0100
commit81a9cb74c355bd0ce98f044f11c46d05f119dac2 (patch)
tree574b64b9ceb4c06607c1046fe98010fb60e88705 /src/Fl_Shortcut_Button.cxx
parentd963dde3efc1fdf4935534f97d76c68eb269b713 (diff)
#862: Fixes Fl_Shortut to swallow all FL_SHORCUT events if hot.
Diffstat (limited to 'src/Fl_Shortcut_Button.cxx')
-rw-r--r--src/Fl_Shortcut_Button.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Fl_Shortcut_Button.cxx b/src/Fl_Shortcut_Button.cxx
index f7d1d5b25..555371e0b 100644
--- a/src/Fl_Shortcut_Button.cxx
+++ b/src/Fl_Shortcut_Button.cxx
@@ -213,6 +213,7 @@ int Fl_Shortcut_Button::handle(int e) {
if (hot_) {
// Note: we can't really handle non-Latin shortcuts in the Fl_Shortcut
// type, so we don't handle them here either
+ // Todo: use fl_utf_tolower and fl_utf_toupper
int v = fl_utf8decode(Fl::event_text(), 0, 0);
if ( (v > 32 && v < 0x7f) || (v > 0xa0 && v <= 0xff) ) {
if (isupper(v)) {
@@ -251,6 +252,9 @@ int Fl_Shortcut_Button::handle(int e) {
}
}
break;
+ case FL_SHORTCUT:
+ if (hot_) return 1;
+ break;
}
return Fl_Button::handle(e);
}