Example #1
0
  def __init__(self, context):
    super().__init__()
    self.on_move = util.QuietSet()
    self.on_click = util.QuietSet()
    self.on_double_click = util.QuietSet()
    self.on_scroll = util.QuietSet()
    self._double_click_detector = base.DoubleClickDetector()
    with context.make_current() as ctx:
      framebuffer_width, window_width = ctx.call(
          self._glfw_setup, context.window)

    self._scale = framebuffer_width * 1.0 / window_width
    self._last_mouse_pos = np.zeros(2, int)

    self._double_clicks = {}
Example #2
0
 def setUp(self):
     super().setUp()
     self.detector = base.DoubleClickDetector()
     self.double_click_event = (user_input.MOUSE_BUTTON_LEFT,
                                user_input.PRESS)