summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-12-30 14:11:04 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-12-30 14:11:04 +0000
commit0ea6761db282d3354fd4a5465785c26071aad6a9 (patch)
treeecd97be87f1393e7f34600cf3c3cddba32a96289 /src
parent5c4e1336ba5004897e3407599be803fc1fa8785e (diff)
- Fixed keyboard shortcut handling in FLUID and shortcut
labeling in FLTK (STR #1129) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4727 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_shortcut.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx
index 31cbe7297..69e11ede5 100644
--- a/src/fl_shortcut.cxx
+++ b/src/fl_shortcut.cxx
@@ -54,6 +54,13 @@
int Fl::test_shortcut(int shortcut) {
if (!shortcut) return 0;
+ int v = shortcut & 0xffff;
+ if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
+ if (isupper(v)) {
+ shortcut |= FL_SHIFT;
+ }
+ }
+
int shift = Fl::event_state();
// see if any required shift flags are off:
if ((shortcut&shift) != (shortcut&0x7fff0000)) return 0;
@@ -118,6 +125,13 @@ const char * fl_shortcut_label(int shortcut) {
static char buf[20];
char *p = buf;
if (!shortcut) {*p = 0; return buf;}
+ // fix upper case shortcuts
+ int v = shortcut & 0xffff;
+ if (v > 32 && v < 0x7f || v > 0xa0 && v <= 0xff) {
+ if (isupper(v)) {
+ shortcut |= FL_SHIFT;
+ }
+ }
#ifdef __APPLE__
// \todo Mac : we might want to change the symbols for Mac users - consider drawing Apple Symbols... .
if (shortcut & FL_SHIFT) {strcpy(p,"Shift+"); p += 6;} //: Mac hollow up arrow