Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-10-02 17:20:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-02 17:25:06 +0300
commitd596a6368cc62d198dd33dadd1cd0831d0de3dee (patch)
treebc1a70f5f4d7411726f0107161d4110de7578dc3 /source/blender/makesrna/intern/rna_userdef.c
parent2e97d50d2d3bdba1ba151d96a6b40382f07785c4 (diff)
Preference: option to use OS-Key to emulate MMB
Alt-LMB is used in quite a few areas now, see T69323 using OS-Key allows these conflicts to be avoided. Currently disabled for WIN32, since it conflicts with the start menu.
Diffstat (limited to 'source/blender/makesrna/intern/rna_userdef.c')
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index c9b6f46ab04..078af30e36c 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -424,6 +424,17 @@ static void rna_userdef_timecode_style_set(PointerRNA *ptr, int value)
}
}
+static int rna_UserDef_mouse_emulate_3_button_modifier_get(PointerRNA *ptr)
+{
+# if !defined(WIN32)
+ UserDef *userdef = ptr->data;
+ return userdef->mouse_emulate_3_button_modifier;
+# else
+ UNUSED_VARS(ptr);
+ return USER_EMU_MMB_MOD_ALT;
+# endif
+}
+
static PointerRNA rna_UserDef_view_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_PreferencesView, ptr->data);
@@ -5487,6 +5498,21 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
+ static const EnumPropertyItem mouse_emulate_3_button_modifier[] = {
+ {USER_EMU_MMB_MOD_ALT, "ALT", 0, "Alt", ""},
+ {USER_EMU_MMB_MOD_OSKEY, "OSKEY", 0, "OS-Key", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ prop = RNA_def_property(srna, "mouse_emulate_3_button_modifier", PROP_ENUM, PROP_NONE);
+ /* Only needed because of WIN32 inability to support the option. */
+ RNA_def_property_enum_funcs(prop, "rna_UserDef_mouse_emulate_3_button_modifier_get", NULL, NULL);
+ RNA_def_property_enum_items(prop, mouse_emulate_3_button_modifier);
+ RNA_def_property_ui_text(
+ prop, "Emulate 3 Button Modifier", "Hold this modifier to emulate the middle mouse button");
+ RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
+ RNA_def_property_update(prop, 0, "rna_userdef_keyconfig_reload_update");
+
prop = RNA_def_property(srna, "use_emulate_numpad", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_NONUMPAD);
RNA_def_property_ui_text(