MCPcopy Create free account
hub / github.com/JacquesLucke/code_autocomplete / execute_on_mouse_click

Method execute_on_mouse_click

modal_handler.py:124–135  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

122 raise BlockEvent()
123
124 def execute_on_mouse_click(self, event):
125 if event.type in ["LEFTMOUSE", "MOUSEMOVE"] and event.value in ["PRESS", "RELEASE"]:
126 for i, line_rectangle in enumerate(self.operator_line_rectangles):
127 if line_rectangle.contains(event.mouse_region_x, event.mouse_region_y):
128 index = self.top_index + i
129 if self.selected_index == index and event.type == "LEFTMOUSE" and event.value == "RELEASE":
130 self.execute_selected_operator()
131 self.hide = True
132 else:
133 if event.value == "PRESS":
134 self.selected_index = index
135 raise BlockEvent()
136
137 def execute_selected_operator(self):
138 try:

Callers 1

Calls 3

BlockEventClass · 0.85
containsMethod · 0.80

Tested by

no test coverage detected