diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2009-04-12 13:48:03 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2009-04-12 13:48:03 +0000 |
| commit | afe1b90dd012216b007112dc5c92f22a1f034bd7 (patch) | |
| tree | 4901f175dfc467c1fad640657e9f0db4f823c8d4 /src/fl_shortcut.cxx | |
| parent | fcfe41ee0566038fcc6c690569b4d04469f43b06 (diff) | |
Reorganized Unittest / fixed and improved OS X keybord support and alternative input methods / fixed OS X utf8 DnD
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6755 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_shortcut.cxx')
| -rw-r--r-- | src/fl_shortcut.cxx | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/fl_shortcut.cxx b/src/fl_shortcut.cxx index b0519d14f..050d454b2 100644 --- a/src/fl_shortcut.cxx +++ b/src/fl_shortcut.cxx @@ -95,9 +95,9 @@ int Fl::test_shortcut(int shortcut) { return 0; } -#if defined(WIN32) || defined(__APPLE__) // if not X // This table must be in numeric order by fltk (X) keysym number: struct Keyname {int key; const char* name;}; +#if defined(WIN32) static Keyname table[] = { {' ', "Space"}, {FL_BackSpace, "Backspace"}, @@ -131,6 +131,40 @@ static Keyname table[] = { {FL_Alt_R, "Alt_R"}, {FL_Delete, "Delete"} }; +#elif defined(__APPLE__) +static Keyname table[] = { + {' ', "Space"}, + {FL_BackSpace,"\xe2\x8c\xab"}, + {FL_Tab, "\xe2\x87\xa5"}, + {0xff0b/*XK_Clear*/, "Clear"}, + {FL_Enter, "\xe2\x86\xa9"}, + {FL_Pause, "Pause"}, + {FL_Scroll_Lock, "Scroll_Lock"}, + {FL_Escape, "\xe2\x90\x9b"}, + {FL_Home, "\xe2\x86\x96"}, + {FL_Left, "\xe2\x86\x90"}, + {FL_Up, "\xe2\x86\x91"}, + {FL_Right, "\xe2\x86\x92"}, + {FL_Down, "\xe2\x86\x93"}, + {FL_Page_Up, "\xe2\x87\x9e"}, // utf8 arrow up with two strokes + {FL_Page_Down,"\xe2\x87\x9f"}, // utf8 arrow down with two strokes + {FL_End, "\xe2\x86\x98"}, + {FL_Print, "Print"}, + {FL_Insert, "Insert"}, + {FL_Menu, "Menu"}, + {FL_Num_Lock, "Num_Lock"}, + {FL_KP_Enter, "\xe2\x86\xb5"}, + {FL_Shift_L, "Shift_L"}, + {FL_Shift_R, "Shift_R"}, + {FL_Control_L,"Control_L"}, + {FL_Control_R,"Control_R"}, + {FL_Caps_Lock,"\xe2\x87\xaa"}, // utf8 Caps Lock symbol + {FL_Meta_L, "Meta_L"}, + {FL_Meta_R, "Meta_R"}, + {FL_Alt_L, "Alt_L"}, + {FL_Alt_R, "Alt_R"}, + {FL_Delete, "\xe2\x8c\xa7"} +}; #endif /** @@ -158,9 +192,9 @@ const char* fl_shortcut_label(int shortcut) { } #ifdef __APPLE__ // \todo Mac : we might want to change the symbols for Mac users - consider drawing Apple Symbols... . - if (shortcut & FL_SHIFT) {strcpy(p,"\xe2\x87\xa7"); p += 3;} //: Mac hollow up arrow - if (shortcut & FL_CTRL) {strcpy(p,"^"); p += 1;} //: Mac ctrl key - if (shortcut & FL_ALT) {strcpy(p,"\xe2\x8e\x87"); p += 3;} //: Mac 'Alt/Option' or fancy switch symbol + if (shortcut & FL_SHIFT) {strcpy(p,"\xe2\x87\xa7"); p += 3;} //: Mac hollow up arrow + if (shortcut & FL_CTRL) {strcpy(p,"\xe2\x8c\x83"); p += 3;} //: Mac ctrl key + if (shortcut & FL_ALT) {strcpy(p,"\xe2\x8e\x87"); p += 3;} //: Mac 'Alt/Option' or fancy switch symbol if (shortcut & FL_META) {strcpy(p,"\xe2\x8c\x98"); p += 3;} //: Mac 'Apple' key #else if (shortcut & FL_META) {strcpy(p,"Meta+"); p += 5;} |
