Keymap: move left click select to a preference
authorCampbell Barton <ideasman42@gmail.com>
Sun, 18 Nov 2018 19:14:20 +0000 (06:14 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 18 Nov 2018 19:27:17 +0000 (06:27 +1100)
17 files changed:
release/scripts/presets/keyconfig/blender.py
release/scripts/presets/keyconfig/blender_27x.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/space_userpref.py
source/blender/blenkernel/BKE_blender_version.h
source/blender/blenkernel/BKE_keyconfig.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/keyconfig.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_userdef.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c

index 060eabe8275cd853ae8ed7c0abcc32a90eb96ab5..c6d106d580627abdcec32891546192f8eec52eda 100644 (file)
@@ -5,8 +5,6 @@ from bpy.props import (
     EnumProperty,
 )
 
-userpref = bpy.context.user_preferences
-
 idname = os.path.splitext(os.path.basename(__file__))[0]
 
 def update(_self, _context):
@@ -16,6 +14,18 @@ def update(_self, _context):
 class Prefs(bpy.types.KeyConfigPreferences):
     bl_idname = idname
 
+    select_mouse: EnumProperty(
+        name="Spacebar",
+        items=(
+            ('LEFT', "Left", "Use left Mouse Button for selection"),
+            ('RIGHT', "Right", "Use Right Mouse Button for selection"),
+        ),
+        description=(
+            "Mouse button used for selection"
+        ),
+        default='RIGHT',
+        update=update,
+    )
     spacebar_action: EnumProperty(
         name="Spacebar",
         items=(
@@ -45,9 +55,14 @@ class Prefs(bpy.types.KeyConfigPreferences):
     )
 
     def draw(self, layout):
+        col = layout.column(align=True)
+        col.label(text="Select With:")
+        col.row().prop(self, "select_mouse", expand=True)
+
         col = layout.column(align=True)
         col.label(text="Spacebar Action:")
         col.row().prop(self, "spacebar_action", expand=True)
+
         layout.prop(self, "use_select_all_toggle")
 
 
@@ -64,13 +79,12 @@ def _load():
 
     keyconfig_data = mod.generate_keymaps(
         mod.KeymapParams(
-            select_mouse=userpref.inputs.select_mouse,
+            select_mouse=kc_prefs.select_mouse,
             spacebar_action=kc_prefs.spacebar_action,
             use_select_all_toggle=kc_prefs.use_select_all_toggle,
         ),
     )
     keyconfig_init_from_data(kc, keyconfig_data)
-    kc.has_select_mouse = True  # Support switching select mouse
 
 
 if __name__ == "__main__":
index 857480b404edf81c67cced751bab7f37a9d12bbe..15888b68e50c09919994908edd0091f458a6392a 100644 (file)
@@ -1,23 +1,56 @@
 import os
 import bpy
+from bpy.props import (
+    EnumProperty,
+)
+
+idname = os.path.splitext(os.path.basename(__file__))[0]
+
+def update(_self, _context):
+    _load()
+
+
+class Prefs(bpy.types.KeyConfigPreferences):
+    bl_idname = idname
 
-userpref = bpy.context.user_preferences
+    select_mouse: EnumProperty(
+        name="Spacebar",
+        items=(
+            ('LEFT', "Left", "Use left Mouse Button for selection"),
+            ('RIGHT', "Right", "Use Right Mouse Button for selection"),
+        ),
+        description=(
+            "Mouse button used for selection"
+        ),
+        default='RIGHT',
+        update=update,
+    )
+
+    def draw(self, layout):
+        col = layout.column(align=True)
+        col.label(text="Select With:")
+        col.row().prop(self, "select_mouse", expand=True)
 
 from bpy_extras.keyconfig_utils import (
-    keyconfig_import_from_data,
+    keyconfig_init_from_data,
     keyconfig_module_from_preset,
 )
 
-_mod = keyconfig_module_from_preset(os.path.join("keymap_data", "blender_default"), __file__)
-keyconfig_data = _mod.generate_keymaps(
-    _mod.KeymapParams(
-        legacy=True,
-        select_mouse=userpref.inputs.select_mouse,
-    ),
-)
+mod = keyconfig_module_from_preset(os.path.join("keymap_data", "blender_default"), __file__)
+
+def _load():
+    kc = bpy.context.window_manager.keyconfigs.new(idname)
+    kc_prefs = kc.preferences
+
+    keyconfig_data = mod.generate_keymaps(
+        mod.KeymapParams(
+            select_mouse=kc_prefs.select_mouse,
+            legacy=True,
+        ),
+    )
+    keyconfig_init_from_data(kc, keyconfig_data)
 
-idname = os.path.splitext(os.path.basename(__file__))[0]
 
 if __name__ == "__main__":
-    kc = keyconfig_import_from_data(idname, keyconfig_data)
-    kc.has_select_mouse = True  # Support switching select mouse
+    bpy.utils.register_class(Prefs)
+    _load()
index c770746666db27ef9a22feb2864ada6649e2b9a0..81183dd3fd62e77f45b03480e7f036106b21e4da 100644 (file)
@@ -2591,12 +2591,17 @@ class WM_MT_splash(Menu):
             text = "Blender"
         sub.menu("USERPREF_MT_keyconfigs", text=text)
 
-        if wm.keyconfigs.active.has_select_mouse:
+        kc = wm.keyconfigs.active
+        kc_prefs = kc.preferences
+        has_select_mouse = hasattr(kc_prefs, "select_mouse")
+        if has_select_mouse:
             sub = col.split(factor=0.35)
             row = sub.row()
             row.alignment = 'RIGHT'
             row.label(text="Select With")
-            sub.row().prop(userpref.inputs, 'select_mouse', expand=True)
+            sub.row().prop(kc_prefs, 'select_mouse', expand=True)
+            has_select_mouse = True
+
 
         col.separator()
 
@@ -2618,7 +2623,7 @@ class WM_MT_splash(Menu):
         #sub.prop(userpref.system, "language", text="")
 
         # Keep height constant
-        if not wm.keyconfigs.active.has_select_mouse:
+        if not has_select_mouse:
             col.label()
 
         layout.label()
index 5a71f98d8f8cd7db586e63a35a2df1874541269b..ace2d1b17d1dcd44c5e502128bc59a89bc0673b5 100644 (file)
@@ -1103,11 +1103,6 @@ class USERPREF_PT_input(Panel):
         sub.prop(inputs, "drag_threshold")
         sub.prop(inputs, "tweak_threshold")
 
-        wm = bpy.context.window_manager
-        if wm.keyconfigs.active.has_select_mouse:
-            sub.label(text="Select With:")
-            sub.row().prop(inputs, "select_mouse", expand=True)
-
         sub = layout.column()
         sub.label(text="Double Click:")
         sub.prop(inputs, "mouse_double_click_time", text="Speed")
index 34a486dd66f959f0a83db889f1c4a42f514e45c0..781dd3f9826a493e00c24f6a25ccc11d7a81eb3e 100644 (file)
@@ -28,7 +28,7 @@
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         280
-#define BLENDER_SUBVERSION      31
+#define BLENDER_SUBVERSION      32
 /* Several breakages with 280, e.g. collections vs layers */
 #define BLENDER_MINVERSION      280
 #define BLENDER_MINSUBVERSION   0
index bef6aab2d82d60ef424b20dcb64168356ae5f328..a086930fe346f8704aca1a9e03e3a7a4646b0fda 100644 (file)
 
 /** Based on #BKE_addon_pref_type_init and friends */
 
-/** Actual data is stored in #wmKeyConfigPrefType. */
+struct UserDef;
+struct wmKeyConfigPref;
+
+/** Actual data is stored in #wmKeyConfigPref. */
 #if defined(__RNA_TYPES_H__)
 typedef struct wmKeyConfigPrefType_Runtime {
        char idname[64];
@@ -39,7 +42,10 @@ typedef struct wmKeyConfigPrefType_Runtime {
 typedef struct wmKeyConfigPrefType_Runtime wmKeyConfigPrefType_Runtime;
 #endif
 
-/* KeyConfig preferenes. */
+/* KeyConfig preferenes (UserDef). */
+struct wmKeyConfigPref *BKE_keyconfig_pref_ensure(struct UserDef *userdef, const char *kc_idname);
+
+/* KeyConfig preferenes (RNA). */
 struct wmKeyConfigPrefType_Runtime *BKE_keyconfig_pref_type_find(const char *idname, bool quiet);
 void BKE_keyconfig_pref_type_add(struct wmKeyConfigPrefType_Runtime *kpt_rt);
 void BKE_keyconfig_pref_type_remove(const struct wmKeyConfigPrefType_Runtime *kpt_rt);
index b90d4fd394881338f6315b154608b040b212cad3..f1b1aa548d2d81a85f617906ab6fa70a556f54a9 100644 (file)
@@ -210,7 +210,7 @@ static void userdef_free_keymaps(UserDef *userdef)
 
 static void userdef_free_keyconfig_prefs(UserDef *userdef)
 {
-       for (wmKeyConfigPrefType *kpt = userdef->user_keyconfig_prefs.first, *kpt_next; kpt; kpt = kpt_next) {
+       for (wmKeyConfigPref *kpt = userdef->user_keyconfig_prefs.first, *kpt_next; kpt; kpt = kpt_next) {
                kpt_next = kpt->next;
                IDP_FreeProperty(kpt->prop);
                MEM_freeN(kpt->prop);
index 46b82569f47306538b24a74242a569b6a956df1f..755c9e1582defa7f49cc170c42b117734500d54b 100644 (file)
 
 #include "BLI_utildefines.h"
 #include "BLI_ghash.h"
+#include "BLI_listbase.h"
+#include "BLI_string.h"
 
 #include "DNA_listBase.h"
+#include "DNA_userdef_types.h"
+#include "DNA_windowmanager_types.h"
 
 #include "BKE_keyconfig.h"  /* own include */
+#include "BKE_idprop.h"
 
 #include "MEM_guardedalloc.h"
 
+
+/* -------------------------------------------------------------------- */
+/** \name Key-Config Preference (UserDef) API
+ *
+ * \see #BKE_addon_pref_type_init for logic this is bases on.
+ * \{ */
+
+wmKeyConfigPref *BKE_keyconfig_pref_ensure(UserDef *userdef, const char *kc_idname)
+{
+       wmKeyConfigPref *kpt = BLI_findstring(
+               &userdef->user_keyconfig_prefs, kc_idname, offsetof(wmKeyConfigPref, idname));
+       if (kpt == NULL) {
+               kpt = MEM_callocN(sizeof(*kpt), __func__);
+               STRNCPY(kpt->idname, kc_idname);
+               BLI_addtail(&userdef->user_keyconfig_prefs, kpt);
+       }
+       if (kpt->prop == NULL) {
+               IDPropertyTemplate val = {0};
+               kpt->prop = IDP_New(IDP_GROUP, &val, kc_idname); /* name is unimportant  */
+       }
+       return kpt;
+}
+
+/** \} */
+
 /* -------------------------------------------------------------------- */
-/** \name Key-Config Preference API
+/** \name Key-Config Preference (RNA Type) API
  *
  * \see #BKE_addon_pref_type_init for logic this is bases on.
  * \{ */
index 90deb0f37ea5bdf8fe766d7b314d9b7558296e95..9596df58170905f3a021bfad9c22f476200d1597 100644 (file)
@@ -8941,7 +8941,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead)
                        direct_link_keymapitem(fd, kmi);
        }
 
-       for (wmKeyConfigPrefType *kpt = user->user_keyconfig_prefs.first; kpt; kpt = kpt->next) {
+       for (wmKeyConfigPref *kpt = user->user_keyconfig_prefs.first; kpt; kpt = kpt->next) {
                kpt->prop = newdataadr(fd, kpt->prop);
                IDP_DirectLinkGroup_OrFree(&kpt->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
        }
index 2cf117067c2c0bc39768b4c7711691c2194dd226..8d8369bc2ef0e0c737e13de7b9bbff83a0a89f29 100644 (file)
@@ -36,7 +36,9 @@
 
 #include "BKE_addon.h"
 #include "BKE_colorband.h"
+#include "BKE_idprop.h"
 #include "BKE_main.h"
+#include "BKE_keyconfig.h"
 
 #include "BLO_readfile.h"  /* Own include. */
 
@@ -94,6 +96,9 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme)
 #undef USER_VERSION_ATLEAST
 }
 
+/* UserDef.flag */
+#define USER_LMOUSESELECT (1 << 14)  /* deprecated */
+
 static void do_version_select_mouse(UserDef *userdef, wmKeyMapItem *kmi)
 {
        /* Remove select/action mouse from user defined keymaps. */
@@ -393,6 +398,14 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
                }
        }
 
+       if (!USER_VERSION_ATLEAST(280, 32)) {
+               if ((userdef->flag & USER_LMOUSESELECT) ) {
+                       userdef->flag &= ~USER_LMOUSESELECT;
+                       wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(userdef, "blender");
+                       IDP_AddToGroup(kpt->prop, IDP_New(IDP_INT, &(IDPropertyTemplate){ .i = 0, }, "select_mouse"));
+               }
+       }
+
        /**
         * Include next version bump.
         */
@@ -415,3 +428,5 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
 #undef USER_VERSION_ATLEAST
 
 }
+
+#undef USER_LMOUSESELECT
index 3d4edc2e4da867298eea4811de7a0c84780ca3b8..99cd9b805bff2a922f54387c77b762aa85a9e09b 100644 (file)
@@ -1248,8 +1248,8 @@ static void write_userdef(WriteData *wd, const UserDef *userdef)
                }
        }
 
-       for (const wmKeyConfigPrefType *kpt = userdef->user_keyconfig_prefs.first; kpt; kpt = kpt->next) {
-               writestruct(wd, DATA, wmKeyConfigPrefType, 1, kpt);
+       for (const wmKeyConfigPref *kpt = userdef->user_keyconfig_prefs.first; kpt; kpt = kpt->next) {
+               writestruct(wd, DATA, wmKeyConfigPref, 1, kpt);
                if (kpt->prop) {
                        IDP_WriteProperty(kpt->prop, wd);
                }
index c358cffa0b4d56bd8f7aa413ad9ab23472d1087a..ffdd371dfdb860a8addeb1ae99e5249873d479af 100644 (file)
@@ -2549,18 +2549,6 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        return OPERATOR_CANCELLED;
 
                case LEFTMOUSE:
-                       if (event->shift && (U.flag & USER_LMOUSESELECT)) {
-                               if (event->val == KM_PRESS) {
-                                       StitchState *selected_state = stitch_select(C, scene, event, ssc);
-
-                                       if (selected_state && !stitch_process_data(ssc, selected_state, scene, false)) {
-                                               stitch_cancel(C, op);
-                                               return OPERATOR_CANCELLED;
-                                       }
-                               }
-                               break;
-                       }
-                       ATTR_FALLTHROUGH;
                case PADENTER:
                case RETKEY:
                        if (event->val == KM_PRESS) {
@@ -2658,7 +2646,7 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                stitch_cancel(C, op);
                                return OPERATOR_CANCELLED;
                        }
-                       if (event->val == KM_PRESS && !(U.flag & USER_LMOUSESELECT)) {
+                       if (event->val == KM_PRESS) {
                                StitchState *selected_state = stitch_select(C, scene, event, ssc);
 
                                if (selected_state && !stitch_process_data(ssc, selected_state, scene, false)) {
index 79a3397b752b164f012b4ffb80c032f9a5a7c6a3..58beb729892b731170e0ebf71acb994d87c42b11 100644 (file)
@@ -569,7 +569,7 @@ typedef struct UserDef {
        struct ListBase uifonts;
        struct ListBase uistyles;
        struct ListBase user_keymaps;
-       struct ListBase user_keyconfig_prefs; /* wmKeyConfigPrefType. */
+       struct ListBase user_keyconfig_prefs; /* wmKeyConfigPref. */
        struct ListBase addons;
        struct ListBase autoexec_paths;
        struct ListBase user_menus; /* bUserMenu */
@@ -700,7 +700,7 @@ typedef enum eUserPref_Flag {
        USER_TOOLTIPS                   = (1 << 11),
        USER_TWOBUTTONMOUSE             = (1 << 12),
        USER_NONUMPAD                   = (1 << 13),
-       USER_LMOUSESELECT               = (1 << 14),
+       USER_FLAG_DEPRECATED_14 = (1 << 14),  /* cleared */
        USER_FILECOMPRESS               = (1 << 15),
        USER_SAVE_PREVIEWS              = (1 << 16),
        USER_CUSTOM_RANGE               = (1 << 17),
index 88974750ffb6fd237924cbc5231a6da18437954d..193c34e3d1198da44d60432d438b250ec9027174 100644 (file)
@@ -352,14 +352,14 @@ enum {
  * This is similar to addon-preferences,
  * however unlike add-ons key-config's aren't saved to disk.
  *
- * #wmKeyConfigPrefType is written to DNA,
+ * #wmKeyConfigPref is written to DNA,
  * #wmKeyConfigPrefType_Runtime has the RNA type.
  */
-typedef struct wmKeyConfigPrefType {
-       struct wmKeyConfigPrefType *next, *prev;
+typedef struct wmKeyConfigPref {
+       struct wmKeyConfigPref *next, *prev;
        char idname[64];    /* unique name */
        IDProperty *prop;
-} wmKeyConfigPrefType;
+} wmKeyConfigPref;
 
 typedef struct wmKeyConfig {
        struct wmKeyConfig *next, *prev;
@@ -370,10 +370,7 @@ typedef struct wmKeyConfig {
        ListBase keymaps;
        int actkeymap;
        short flag;
-
-       /* Supports select mouse switching? */
-       char has_select_mouse;  /* may remove in favor of custom properties. */
-       char _pad0;
+       char _pad0[2];
 } wmKeyConfig;
 
 /* wmKeyConfig.flag */
index 597d93c01e5c5164cce4c939ff79da4d0ebd340e..62479240b72e57fbe65f163654c575ce7f5e1c25 100644 (file)
@@ -210,23 +210,6 @@ static void rna_userdef_undo_steps_set(PointerRNA *ptr, int value)
        userdef->undosteps = (value == 1) ? 2 : value;
 }
 
-static void rna_userdef_select_mouse_set(PointerRNA *ptr, int value)
-{
-       UserDef *userdef = (UserDef *)ptr->data;
-
-       if (value) {
-               userdef->flag |= USER_LMOUSESELECT;
-               userdef->flag &= ~USER_TWOBUTTONMOUSE;
-       }
-       else
-               userdef->flag &= ~USER_LMOUSESELECT;
-}
-
-static void rna_userdef_select_mouse_update(bContext *C, Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
-{
-       WM_keyconfig_reload(C);
-}
-
 static int rna_userdef_autokeymode_get(PointerRNA *ptr)
 {
        UserDef *userdef = (UserDef *)ptr->data;
@@ -4500,12 +4483,6 @@ static void rna_def_userdef_input(BlenderRNA *brna)
        PropertyRNA *prop;
        StructRNA *srna;
 
-       static const EnumPropertyItem select_mouse_items[] = {
-               {USER_LMOUSESELECT, "LEFT", 0, "Left", "Use left Mouse Button for selection"},
-               {0, "RIGHT", 0, "Right", "Use Right Mouse Button for selection"},
-               {0, NULL, 0, NULL, NULL}
-       };
-
        static const EnumPropertyItem view_rotation_items[] = {
                {0, "TURNTABLE", 0, "Turntable", "Use turntable style rotation in the viewport"},
                {USER_TRACKBALL, "TRACKBALL", 0, "Trackball", "Use trackball style rotation in the viewport"},
@@ -4546,14 +4523,6 @@ static void rna_def_userdef_input(BlenderRNA *brna)
        RNA_def_struct_clear_flag(srna, STRUCT_UNDO);
        RNA_def_struct_ui_text(srna, "Input", "Settings for input devices");
 
-       prop = RNA_def_property(srna, "select_mouse", PROP_ENUM, PROP_NONE);
-       RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
-       RNA_def_property_enum_items(prop, select_mouse_items);
-       RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_select_mouse_set", NULL);
-       RNA_def_property_ui_text(prop, "Select Mouse", "Mouse button used for selection");
-       RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
-       RNA_def_property_update(prop, 0, "rna_userdef_select_mouse_update");
-
        prop = RNA_def_property(srna, "view_zoom_method", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "viewzoom");
        RNA_def_property_enum_items(prop, view_zoom_styles);
index 6ad5e365e03725716bb20a7e53d33907d909254d..ab06673fe71fc8ffd8b555d475d695e660721544 100644 (file)
@@ -996,17 +996,7 @@ static PointerRNA rna_wmKeyConfig_preferences_get(PointerRNA *ptr)
        wmKeyConfig *kc = ptr->data;
        wmKeyConfigPrefType_Runtime *kpt_rt = BKE_keyconfig_pref_type_find(kc->idname, true);
        if (kpt_rt) {
-               wmKeyConfigPrefType *kpt = BLI_findstring(
-                       &U.user_keyconfig_prefs, kc->idname, offsetof(wmKeyConfigPrefType, idname));
-               if (kpt == NULL) {
-                       kpt = MEM_callocN(sizeof(*kpt), __func__);
-                       STRNCPY(kpt->idname, kc->idname);
-                       BLI_addtail(&U.user_keyconfig_prefs, kpt);
-               }
-               if (kpt->prop == NULL) {
-                       IDPropertyTemplate val = {0};
-                       kpt->prop = IDP_New(IDP_GROUP, &val, kc->idname); /* name is unimportant  */
-               }
+               wmKeyConfigPref *kpt = BKE_keyconfig_pref_ensure(&U, kc->idname);
                return rna_pointer_inherit_refine(ptr, kpt_rt->ext.srna, kpt->prop);
        }
        else {
@@ -1045,7 +1035,7 @@ static StructRNA *rna_wmKeyConfigPref_register(
         StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free)
 {
        wmKeyConfigPrefType_Runtime *kpt_rt, dummy_kpt_rt = {{'\0'}};
-       wmKeyConfigPrefType dummy_kpt = {NULL};
+       wmKeyConfigPref dummy_kpt = {NULL};
        PointerRNA dummy_ptr;
        // int have_function[1];
 
@@ -2317,7 +2307,7 @@ static void rna_def_keyconfig_prefs(BlenderRNA *brna)
 
        srna = RNA_def_struct(brna, "KeyConfigPreferences", NULL);
        RNA_def_struct_ui_text(srna, "Key-Config Preferences", "");
-       RNA_def_struct_sdna(srna, "wmKeyConfigPrefType");  /* WARNING: only a bAddon during registration */
+       RNA_def_struct_sdna(srna, "wmKeyConfigPref");  /* WARNING: only a bAddon during registration */
 
        RNA_def_struct_refine_func(srna, "rna_wmKeyConfigPref_refine");
        RNA_def_struct_register_funcs(srna, "rna_wmKeyConfigPref_register", "rna_wmKeyConfigPref_unregister", NULL);
@@ -2367,10 +2357,6 @@ static void rna_def_keyconfig(BlenderRNA *brna)
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "User Defined", "Indicates that a keyconfig was defined by the user");
 
-       prop = RNA_def_property(srna, "has_select_mouse", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "has_select_mouse", 1);
-       RNA_def_property_ui_text(prop, "Has Select Mouse", "Configuration supports select mouse switching");
-
        /* Collection active property */
        prop = RNA_def_property(srna, "preferences", PROP_POINTER, PROP_NONE);
        RNA_def_property_struct_type(prop, "KeyConfigPreferences");
index 5cafbaf6b038ab98284b7d605ce3deae83c2a31a..517f92491f0d8a7617b4a7b3dccd264a2a317c07 100644 (file)
@@ -693,9 +693,16 @@ wmKeyMap *WM_gizmogroup_keymap_common_select(
 {
        /* Use area and region id since we might have multiple gizmos with the same name in different areas/regions */
        wmKeyMap *km = WM_keymap_ensure(config, gzgt->name, gzgt->gzmap_params.spaceid, gzgt->gzmap_params.regionid);
+       /* FIXME(campbell) */
+#if 0
        const int select_mouse = (U.flag & USER_LMOUSESELECT) ? LEFTMOUSE : RIGHTMOUSE;
        const int select_tweak = (U.flag & USER_LMOUSESELECT) ? EVT_TWEAK_L : EVT_TWEAK_R;
        const int action_mouse = (U.flag & USER_LMOUSESELECT) ? RIGHTMOUSE : LEFTMOUSE;
+#else
+       const int select_mouse = RIGHTMOUSE;
+       const int select_tweak = EVT_TWEAK_R;
+       const int action_mouse = LEFTMOUSE;
+#endif
 
        WM_keymap_add_item(km, "GIZMOGROUP_OT_gizmo_tweak", action_mouse, KM_PRESS, KM_ANY, 0);
        WM_keymap_add_item(km, "GIZMOGROUP_OT_gizmo_tweak", select_tweak, KM_ANY, 0, 0);