diff options
| author | Bill Spitzak <spitzak@gmail.com> | 2000-05-10 16:43:36 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 2000-05-10 16:43:36 +0000 |
| commit | eb633643118c41afbfc88654045b1edde5cb9658 (patch) | |
| tree | b7f4382201be1b35ef0342dfecee630d98747981 | |
| parent | 209917376186795106740a8698345b81b4fd976f (diff) | |
XForms-compatable shortcut strings modified so that "0xabcd" can specify
an arbitrary key by hex code. Lame but needed for some DD software...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1113 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl.cxx | 13 | ||||
| -rw-r--r-- | src/fl_shortcut.cxx | 16 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index cbcfbd98d..6ca0647ce 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -1,6 +1,6 @@ #include <stdio.h> // -// "$Id: Fl.cxx,v 1.24.2.18 2000/04/25 22:16:17 mike Exp $" +// "$Id: Fl.cxx,v 1.24.2.19 2000/05/10 16:43:35 bill Exp $" // // Main event handling code for the Fast Light Tool Kit (FLTK). // @@ -696,15 +696,6 @@ void Fl_Window::flush() { draw(); } -int fl_old_shortcut(const char* s) { - if (!s || !*s) return 0; - int n = 0; - if (*s == '#') {n |= FL_ALT; s++;} - if (*s == '+') {n |= FL_SHIFT; s++;} - if (*s == '^') {n |= FL_CTRL; s++;} - return n | *s; -} - // -// End of "$Id: Fl.cxx,v 1.24.2.18 2000/04/25 22:16:17 mike Exp $". +// End of "$Id: Fl.cxx,v 1.24.2.19 2000/05/10 16:43:35 bill Exp $". // diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index 5ba3d513b..2d31efedf 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_shortcut.cxx,v 1.4.2.4 2000/04/25 22:16:45 mike Exp $" +// "$Id: fl_shortcut.cxx,v 1.4.2.5 2000/05/10 16:43:36 bill Exp $" // // Shortcut support routines for the Fast Light Tool Kit (FLTK). // @@ -158,6 +158,18 @@ const char * fl_shortcut_label(int shortcut) { #endif } +// Emulation of XForms named shortcuts +#include <stdlib.h> +int fl_old_shortcut(const char* s) { + if (!s || !*s) return 0; + int n = 0; + if (*s == '#') {n |= FL_ALT; s++;} + if (*s == '+') {n |= FL_SHIFT; s++;} + if (*s == '^') {n |= FL_CTRL; s++;} + if (s[1]) return n | (int)strtol(s,0,0); // allow 0xf00 to get any key + return n | *s; +} + // Tests for &x shortcuts in button labels: int Fl_Widget::test_shortcut(const char *label) { @@ -179,5 +191,5 @@ int Fl_Widget::test_shortcut() { } // -// End of "$Id: fl_shortcut.cxx,v 1.4.2.4 2000/04/25 22:16:45 mike Exp $". +// End of "$Id: fl_shortcut.cxx,v 1.4.2.5 2000/05/10 16:43:36 bill Exp $". // |
