diff --git a/__init__.py b/__init__.py index a6ed138..e0712ea 100644 --- a/__init__.py +++ b/__init__.py @@ -97,6 +97,11 @@ class NDPreferences(AddonPreferences): default=False, ) + enable_right_click_select: BoolProperty( + name="Enable Right Click Select", + default=False, + ) + enable_deprecated_features: BoolProperty( name="Compatibility Mode", default=False, @@ -463,7 +468,8 @@ def draw_general(self, box): "utils_collection_name", "use_fast_booleans", "recon_poly_solidify", - "recon_poly_inscribed"] + "recon_poly_inscribed", + "enable_right_click_select"] for pref in general_prefs: column = box.column(align=True) diff --git a/lib/events.py b/lib/events.py index 24623a1..e8452ee 100644 --- a/lib/events.py +++ b/lib/events.py @@ -63,9 +63,15 @@ def capture_modifier_keys(cls, event=None, mouse_x=0): cls.key_step_down = detected(event, {'WHEELDOWNMOUSE'}) or pressed(event, {'DOWN_ARROW'}) or pressed(event, {'LEFT_ARROW'}) cls.key_confirm = clicked(event, {'LEFTMOUSE'}) or pressed(event, {'SPACE', 'RET', 'NUMPAD_ENTER'}) - cls.key_left_click = detected(event, {'LEFTMOUSE'}) + + if get_preferences().enable_right_click_select: + cls.key_select = detected(event, {'RIGHTMOUSE'}) + cls.key_cancel = pressed(event, {'ESC'}) + else: + cls.key_select = detected(event, {'LEFTMOUSE'}) + cls.key_cancel = clicked(event, {'RIGHTMOUSE'}) or pressed(event, {'ESC'}) + cls.key_confirm_alternative = pressed(event, {'SPACE', 'RET', 'NUMPAD_ENTER'}) - cls.key_cancel = clicked(event, {'RIGHTMOUSE'}) or pressed(event, {'ESC'}) cls.key_movement_passthrough = detected(event, {'MIDDLEMOUSE'}) or (has(event) and event.alt and event.type in {'LEFTMOUSE', 'RIGHTMOUSE'}) or (has(event) and event.type.startswith('NDOF')) diff --git a/replicate/mirror.py b/replicate/mirror.py index cad630d..770f6ce 100644 --- a/replicate/mirror.py +++ b/replicate/mirror.py @@ -97,7 +97,7 @@ def modal(self, context, event): if self.geometry_mode and not self.geometry_ready: return self.complete_geometry_mode(context) - elif self.key_left_click and self.geometry_mode and not self.geometry_ready: + elif self.key_select and self.geometry_mode and not self.geometry_ready: return {'PASS_THROUGH'} elif self.key_confirm: diff --git a/sketch/geo_lift.py b/sketch/geo_lift.py index 3779375..56f7d1c 100644 --- a/sketch/geo_lift.py +++ b/sketch/geo_lift.py @@ -56,7 +56,7 @@ def modal(self, context, event): return {'PASS_THROUGH'} - elif self.key_left_click: + elif self.key_select: return {'PASS_THROUGH'} elif get_preferences().enable_experimental_features and self.key_undo: diff --git a/sketch/panel.py b/sketch/panel.py index 5bb9ec5..49c274e 100644 --- a/sketch/panel.py +++ b/sketch/panel.py @@ -104,7 +104,7 @@ def do_modal(self, context, event): self.stage = 1 self.dirty = True - if self.stage == 0 and self.key_left_click: + if self.stage == 0 and self.key_select: return {'PASS_THROUGH'} if self.key_cancel: diff --git a/sketch/view_align.py b/sketch/view_align.py index 7292e96..aa6b798 100644 --- a/sketch/view_align.py +++ b/sketch/view_align.py @@ -97,7 +97,7 @@ def modal(self, context, event): elif self.key_confirm_alternative: return self.finish(context) - elif self.key_left_click: + elif self.key_select: return {'PASS_THROUGH'} elif self.key_movement_passthrough: