From 72f835c00565835a536531cd81dc6d9a607b615a Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 30 Jun 2017 15:47:51 +0200 Subject: Use Meta for shortcuts on Mac OS --- share/keys/default.xml | 368 +++++++++++++++++++++++++------------------------ src/shortcuts.cpp | 6 + 2 files changed, 191 insertions(+), 183 deletions(-) diff --git a/share/keys/default.xml b/share/keys/default.xml index 134251752..9a072d9da 100644 --- a/share/keys/default.xml +++ b/share/keys/default.xml @@ -11,7 +11,9 @@ source locally, you can view that file at: http://git.gnome.org/browse/gtk+/plain/gdk/gdkkeysyms.h - The "modifiers" attribute contains a comma-separated list of modifiers, which can be -one or more of: "Ctrl", "Shift", "Alt". +one or more of: "Ctrl", "Shift", "Alt", "Meta", "Super", "Hyper", or "Primary". + +"Primary" means Meta on Apple and Primary everywhere else, it's recommended over the use of Ctrl. - The "action" attribute contains the name of the action. The complete list of actions (called "verbs") is in the file src/verbs.cpp in Inkscape source; there you can see @@ -41,42 +43,42 @@ override) the bindings in the main default.xml. - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -152,7 +154,7 @@ override) the bindings in the main default.xml. - + @@ -174,13 +176,13 @@ override) the bindings in the main default.xml. - + - + @@ -232,8 +234,8 @@ override) the bindings in the main default.xml. - - + + @@ -245,12 +247,12 @@ override) the bindings in the main default.xml. - + - - - - + + + + @@ -266,11 +268,11 @@ override) the bindings in the main default.xml. - - + + - - + + @@ -281,8 +283,8 @@ override) the bindings in the main default.xml. - - + + @@ -295,35 +297,35 @@ override) the bindings in the main default.xml. - - - + + + - - - - + + + + - - + + - - + + - - - + + + - - + + - - + + - - + + @@ -336,8 +338,8 @@ override) the bindings in the main default.xml. - - + + @@ -352,13 +354,13 @@ override) the bindings in the main default.xml. - - + + - - + + @@ -385,8 +387,8 @@ override) the bindings in the main default.xml. - - + + @@ -414,8 +416,8 @@ override) the bindings in the main default.xml. - - + + @@ -423,18 +425,18 @@ override) the bindings in the main default.xml. - - + + - - - - + + + + - - - - + + + + @@ -471,46 +473,46 @@ override) the bindings in the main default.xml. - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - - - + + + + + - - + + - - + + - - - + + + - - - - + + + + @@ -518,10 +520,10 @@ override) the bindings in the main default.xml. - - - - + + + + @@ -529,14 +531,14 @@ override) the bindings in the main default.xml. - - + + - - + + - - + + @@ -554,32 +556,32 @@ override) the bindings in the main default.xml. - - + + - - + + - - - - + + + + - - + + - - + + - - + + - - + + @@ -589,8 +591,8 @@ override) the bindings in the main default.xml. - - + + @@ -608,46 +610,46 @@ override) the bindings in the main default.xml. - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -659,26 +661,26 @@ override) the bindings in the main default.xml. - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -699,15 +701,15 @@ override) the bindings in the main default.xml. effect id from the .inx file, for example "org.ekips.filter.addnodes" for the Add Nodes effect. --> - - + + - - + + diff --git a/src/shortcuts.cpp b/src/shortcuts.cpp index 0cb0285f8..8a8d36d5a 100644 --- a/src/shortcuts.cpp +++ b/src/shortcuts.cpp @@ -625,6 +625,12 @@ static void read_shortcuts_file(char const *filename, bool const is_user_set) { modifiers |= SP_SHORTCUT_HYPER_MASK; } else if (!strcmp(mod, "Meta")) { modifiers |= SP_SHORTCUT_META_MASK; + } else if (!strcmp(mod, "Primary")) { +#ifdef __APPLE__ + modifiers |= SP_SHORTCUT_META_MASK; +#else + modifiers |= SP_SHORTCUT_CONTROL_MASK; +#endif } else { g_warning("Unknown modifier %s for %s", mod, verb_name); } -- cgit v1.2.3