summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-11 19:10:39 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-02-11 19:10:39 +0100
commitcf551ddf5a1fb72f56ca31187acb0bbf1951cdb6 (patch)
tree813a304f79742bc18fd481a672f77b623aab5d4d
parent4ea058da0aaa5f477bb24d3fda4e19e82019fa87 (diff)
Improve recognition of re-scaling shortcuts - cont'd
-rw-r--r--src/Fl_Screen_Driver.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index ecb0c7752..048ffd676 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -482,10 +482,11 @@ int Fl_Screen_Driver::scale_handler(int event)
if (!keyboard_screen_scaling) return 0;
if ( event != FL_SHORTCUT || !Fl::event_command() ) return 0;
const char *key = Fl::event_text();
+ char ek[2] = "";
if (!key || !*key) {
- static char ek;
- ek = Fl::event_key() & ~(FL_SHIFT+FL_COMMAND);
- key = &ek;
+ ek[0] = (char)(Fl::event_key() & 0xff);
+ ek[1] = '\0';
+ key = (const char *)ek;
}
enum {none, zoom_in, zoom_out, zoom_reset} zoom = none;
if (key[0] == '0' || (strcmp(key, "à") == 0 /* for Fr keyboards*/)) zoom = zoom_reset;