diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-06 02:02:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-06 02:05:53 +0300 |
commit | 75b739c969ce851495ce28a7f92decc8c24de733 (patch) | |
tree | 2bc3082f2c3fd821fb55322b58f3c05a696c659c /release | |
parent | 095f9f26aabcc3edd8f7ad4d0e74fb4de979aa1a (diff) |
Keymap: only use MMB workaround whe MMB is enabled
Using double-click with selection breaks selection cycling behavior
(making you have to wait to click again to cycle-select the next item).
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/presets/keyconfig/blender.py | 5 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/blender_27x.py | 5 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 22 |
3 files changed, 23 insertions, 9 deletions
diff --git a/release/scripts/presets/keyconfig/blender.py b/release/scripts/presets/keyconfig/blender.py index bda19e075a3..ff8edbdede7 100644 --- a/release/scripts/presets/keyconfig/blender.py +++ b/release/scripts/presets/keyconfig/blender.py @@ -105,14 +105,17 @@ blender_default = bpy.utils.execfile(os.path.join(dirname, "keymap_data", "blend def load(): + from bpy import context from bl_keymap_utils.io import keyconfig_init_from_data - kc = bpy.context.window_manager.keyconfigs.new(idname) + prefs = context.user_preferences + kc = context.window_manager.keyconfigs.new(idname) kc_prefs = kc.preferences keyconfig_data = blender_default.generate_keymaps( blender_default.Params( select_mouse=kc_prefs.select_mouse, + use_mouse_emulate_3_button=prefs.inputs.use_mouse_emulate_3_button, spacebar_action=kc_prefs.spacebar_action, use_select_all_toggle=kc_prefs.use_select_all_toggle, use_v3d_tab_menu=kc_prefs.use_v3d_tab_menu, diff --git a/release/scripts/presets/keyconfig/blender_27x.py b/release/scripts/presets/keyconfig/blender_27x.py index 738f7523e11..d60324f22d6 100644 --- a/release/scripts/presets/keyconfig/blender_27x.py +++ b/release/scripts/presets/keyconfig/blender_27x.py @@ -42,14 +42,17 @@ class Prefs(bpy.types.KeyConfigPreferences): blender_default = bpy.utils.execfile(os.path.join(dirname, "keymap_data", "blender_default.py")) def load(): + from bpy import context from bl_keymap_utils.io import keyconfig_init_from_data - kc = bpy.context.window_manager.keyconfigs.new(idname) + prefs = context.user_preferences + kc = context.window_manager.keyconfigs.new(idname) kc_prefs = kc.preferences keyconfig_data = blender_default.generate_keymaps( blender_default.Params( select_mouse=kc_prefs.select_mouse, + use_mouse_emulate_3_button=prefs.inputs.use_mouse_emulate_3_button, spacebar_action='SEARCH', use_select_all_toggle=True, legacy=True, diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 09fdd202932..78f71999065 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -34,6 +34,7 @@ class Params: "context_menu_event", "cursor_set_event", "cursor_tweak_event", + "use_mouse_emulate_3_button", # User preferences. # @@ -52,6 +53,7 @@ class Params: *, legacy=False, select_mouse='RIGHT', + use_mouse_emulate_3_button=False, # User preferences. spacebar_action='TOOL', @@ -97,6 +99,8 @@ class Params: self.cursor_set_event = {"type": 'RIGHTMOUSE', "value": 'PRESS', "shift": True} self.cursor_tweak_event = {"type": 'EVT_TWEAK_R', "value": 'ANY', "shift": True} + self.use_mouse_emulate_3_button = use_mouse_emulate_3_button + # User preferences self.spacebar_action = spacebar_action self.use_select_all_toggle = use_select_all_toggle @@ -3766,13 +3770,7 @@ def km_mesh(params): {"properties": [("vertex_only", True)]}), # Selection modes. *_template_items_editmode_mesh_select_mode(), - # Loop Select with alt, and double click in case MMB emulation is on. - ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK'}, - {"properties": [("extend", False), ("deselect", False), ("toggle", False)]}), - ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "shift": True}, - {"properties": [("extend", True), ("deselect", False), ("toggle", False)]}), - ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "alt": True}, - {"properties": [("extend", False), ("deselect", True), ("toggle", False)]}), + # Loop Select with alt. Double click in case MMB emulation is on (below). ("mesh.loop_select", {"type": params.select_mouse, "value": params.select_mouse_value, "alt": True}, {"properties": [("extend", False), ("deselect", False), ("toggle", False)]}), ("mesh.loop_select", {"type": params.select_mouse, "value": params.select_mouse_value, "shift": True, "alt": True}, @@ -3856,6 +3854,16 @@ def km_mesh(params): *_template_items_proportional_editing(connected=True), ]) + if params.use_mouse_emulate_3_button: + items.extend([ + ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK'}, + {"properties": [("extend", False), ("deselect", False), ("toggle", False)]}), + ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "shift": True}, + {"properties": [("extend", True), ("deselect", False), ("toggle", False)]}), + ("mesh.loop_select", {"type": params.select_mouse, "value": 'DOUBLE_CLICK', "alt": True}, + {"properties": [("extend", False), ("deselect", True), ("toggle", False)]}), + ]) + if params.legacy: items.extend([ ("mesh.poke", {"type": 'P', "value": 'PRESS', "alt": True}, None), |