Example #1
0
def bind_mouse(function):
    Window.show_cursor = False
    win_center_x = Window.left + Window.width // 2
    win_center_y = Window.top + Window.height // 2
    Window.grab_mouse()
    set_cursor_position(win_center_x, win_center_y)
    Window._mouse_bound = True
    Window._mouse_bound_function = function
    Window.bind(mouse_pos=_on_bound_mouse_move)
Example #2
0
 def enter_mouse_control(self):
     """ 
     """
     _center_cursor()
     self._mouse_controlled.add(self)
     self._last_mouse_controlled = self
     Window.bind(mouse_pos=self._on_bound_mouse_move)
     if self._mouse_controlled:
         Window.show_cursor = False
         Window.grab_mouse()
Example #3
0
 def win_max(self, *args):
     Window.grab_mouse()
     Window.toggle_fullscreen()
     self.m_fullscreen = True