Skip to content

Commit

Permalink
fix: fix left-click handling for operators that need to pass through …
Browse files Browse the repository at this point in the history
…the event
  • Loading branch information
tristan-hm committed May 13, 2022
1 parent c04c466 commit 8a335b2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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'}) or pressed(event, {'A'}) or pressed(event, {'S'})

cls.key_confirm = clicked(event, {'LEFTMOUSE'}) or pressed(event, {'SPACE', 'RET'})
cls.key_left_click = detected(event, {'LEFTMOUSE'})
cls.key_confirm_alternative = pressed(event, {'SPACE', 'RET'})
cls.key_cancel = clicked(event, {'RIGHTMOUSE'}) or pressed(event, {'ESC'})

Expand Down
3 changes: 3 additions & 0 deletions power_mods/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ 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:
return {'PASS_THROUGH'}

elif self.key_confirm:
if self.geometry_mode and not self.geometry_ready:
return {'PASS_THROUGH'}
Expand Down
2 changes: 1 addition & 1 deletion sketching/geo_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def modal(self, context, event):
elif self.key_confirm_alternative:
return self.finish(context)

elif self.key_confirm:
elif self.key_left_click:
return {'PASS_THROUGH'}

elif self.key_cancel:
Expand Down
2 changes: 1 addition & 1 deletion sketching/view_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def modal(self, context, event):
elif self.key_confirm_alternative:
return self.finish(context)

elif self.key_confirm:
elif self.key_left_click:
return {'PASS_THROUGH'}

elif self.key_movement_passthrough:
Expand Down

0 comments on commit 8a335b2

Please sign in to comment.