Пример #1
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.logger = logger.getChild("mouse")
     self.logger.setLevel(logging.INFO)
     self.new_event = threading.Event()
     self.pos = None
     self._reset_data()
Пример #2
0
 def __init__(self, num_parking_spots):
     PyMouseEvent.__init__(self)
     self.point_ctr = 0
     self.line_ctr = 0
     self.num_parking_spots = num_parking_spots
     self.mouse = pymouse.PyMouse()
     sys.stdout.write(str(self.line_ctr))
Пример #3
0
    def __init__(self, logdata):
        PyMouseEvent.__init__(self)
        self.logdata = logdata

        self.mouse_x = 0
        self.mouse_y = 0
        self.lastMoveTime = time.time()
Пример #4
0
    def __init__(self):
        PyMouseEvent.__init__(self)
        self.MousePositions = []
        self.NumPositions = 0

        # Instantiate an mouse object
        self.mouse = PyMouse()
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.logger = logger.getChild("mouse")
     self.logger.setLevel(logging.INFO)
     self.new_event = threading.Event()
     self.pos = None
     self._reset_data()
Пример #6
0
    def __init__(self, state=None):
        PyMouseEvent.__init__(self)
        self._sp = screen_pixel.screen_pixel()
        self._state = state
        self._first_click = True

        # [Trying to account for differences in OSX/Windows]:
        if sys.platform == 'darwin':
            self._y_offset = 0  #-40 #-80 #-75 ???
        else:
            self._y_offset = -30

        if state == 'mouse_actionbar':
            print(
                '[Go click your fishing_pole on your actionbar! Come back here!]'
            )
            self._yield_skills = self.yield_actionbar_skills()

        elif state == 'scanarea' or state == 'health' or state == 'login':
            print(
                '[Calibrating {0}: Click at the top-left of the area, then click on the lower-right area you want to scan.]'
                .format(state))
        elif state == 'tooltip':
            self._sp.capture()
            self._nemo = self._sp._numpy
            print(
                'Click at the top-left of the tooltip, then again on the lower-right of the tooltip.]'
            )
        else:
            print('[mouse_calibrator started without state]')
            sys.exit(1)
Пример #7
0
 def __init__(self, lgtv):
     PyMouseEvent.__init__(self)
     self.lgtv = lgtv
     self.x = 0
     self.y = 0
     self.refresh_rate = 2 #bigger = slower
     self.sensitivity = 1 #bigger = higher
     self.count = 0
Пример #8
0
    def __init__(self, object2notify):
        """Create MouseListener.

        :param object2notify: MainTimer object
        :type object2notify: MainTimer
        """
        CommonListener.__init__(self, object2notify)
        PyMouseEvent.__init__(self)
Пример #9
0
    def __init__(self, object2notify):
        """Create MouseListener.

        :param object2notify: MainTimer object
        :type object2notify: MainTimer
        """
        CommonListener.__init__(self, object2notify)
        PyMouseEvent.__init__(self)
Пример #10
0
    def __init__(self, state=None):
        PyMouseEvent.__init__(self)
        self._sp = screen_pixel.screen_pixel()
        self._state = state

        # [Trying to account for differences in OSX/Windows]:
        if sys.platform == 'darwin':
            self._y_offset = -80  #-75 ???
        else:
            self._y_offset = -30

        if state == 'mouse_actionbar':
            print(
                '[Go click your fishing_pole on your actionbar! Come back here!]'
            )
            self._yield_skills = self.yield_actionbar_skills()

        elif state == 'scanarea' or state == 'health' or state == 'login':
            print(
                '[Calibrating {0}: Click at the top-left of the area, && drag to lower-right and release click.]'
                .format(state))
            self._sp.capture()
            self._nemo = self._sp._numpy

            # [Windows might need this at 50% in WoW too?]:
            if sys.platform == 'darwin':
                self._nemo = self._sp.resize_image(self._nemo,
                                                   scale_percent=50)

            cv2.imshow('Calibrate {0}'.format(state), self._nemo)
            cv2.moveWindow('Calibrate {0}'.format(state), 0, 0)
        elif state == 'tooltip':
            print(
                'Click at the top-left of the tooltip, && drag to lower-right and release.]'
            )

            self._sp.capture(
            )  #Capture so we can get width/height, pass in the numpy array:
            self._nemo = self._sp.grab_rect(
                {
                    "x": int(self._sp._width / 2),
                    "y": int(self._sp._height / 2)
                }, {
                    "x": int(self._sp._width),
                    "y": int(self._sp._height)
                },
                mod=1,
                nemo=self._sp._numpy)

            cv2.imshow('Calibrate Tooltip', self._nemo)
            cv2.moveWindow('Calibrate Tooltip', 0, 0)
        else:
            print('[mouse_calibrator started without state]')
            sys.exit(1)
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.in_movment = 0
     (self.x, self.y) = (0, 0)
     self.move_analysis = []
     self.move_element_db = []
     self.start_time = 0
     self.end_time = 0
     self.click_time = 0
     self.move_time = 0
     self.event = threading.Event()
Пример #12
0
 def __init__(self, clicksPerSecond = 5, randomizeRange = 0, toggleClick = False, holdClick = True, keyToUse = "Shift_L"):
     PyMouseEvent.__init__(self)
     self.isClicking = False
     if clicksPerSecond > 0:
         self.clicksPerSecond = clicksPerSecond
     else:
         raise ValueError("Clicks per second must be greater than 0.")
     if randomizeRange >= 0:
         self.randomizeRange = randomizeRange
     else:
         raise ValueError("Random range must be greater than or equal to 0.")
     self.mouse = PyMouse()
     self.toggleClick = toggleClick
     self.holdClick = holdClick
     self.keyToUse = keyToUse
     self.initHookManager()
Пример #13
0
 def __init__(self,
              clicksPerSecond=5,
              randomizeRange=0,
              toggleClick=False,
              holdClick=True,
              keyToUse="Shift_L"):
     PyMouseEvent.__init__(self)
     self.isClicking = False
     if clicksPerSecond > 0:
         self.clicksPerSecond = clicksPerSecond
     else:
         raise ValueError("Clicks per second must be greater than 0.")
     if randomizeRange >= 0:
         self.randomizeRange = randomizeRange
     else:
         raise ValueError(
             "Random range must be greater than or equal to 0.")
     self.mouse = PyMouse()
     self.toggleClick = toggleClick
     self.holdClick = holdClick
     self.keyToUse = keyToUse  #"Caps_Lock"
     self.initHookManager()
Пример #14
0
	def __init__(self,max_width,max_height,wm_width=2,wm_height=44,clickable_offset=23, margin=10):
		PyMouseEvent.__init__(self)
		
		#get these programmatically
		self.WM_WIDTH = int(wm_width) ##WM side of window width in pixels
		self.WM_HEIGHT = int(wm_height) #WM top of window height in pixels
		self.CLICKABLE_OFFSET = int(clickable_offset) #number of pixels on the WM window that are not moving the window when clicked
		self.MARGIN = int(margin) #dictates when snapping occures
		#self.WM_BOTTOM_HEIGHT = 4 #number of pixels at the bottom of each window
		#self.TASKBAR_HEIGHT = 30 #height of the taskbar in pixels, atm only taskbars at the bottom are considered 
		###########################################

		self.MAX_WINDOW_WIDTH = int(max_width)
		self.MAX_WINDOW_HEIGHT = int(max_height)
		

		self.mouse = PyMouse()
		screen_size = self.mouse.screen_size()
		self.screen_width = screen_size[0]
		self.screen_height = screen_size[1]
		self.counter = COUNTER 
		self.original_window_sizes = {} #info used to restore windows when 'unsnapping' them
Пример #15
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.x = None
     self.y = None
 def __init__(self):
     PyMouseEvent.__init__(self)
     print "hello!"
     self.state = self.NOT_CLICKED
Пример #17
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.s_x = 0
     self.s_y = 0
     self.mouse = PyMouse()
 def run(self):
     #inspired by this guide on python automation https://automatetheboringstuff.com/chapter18/
     try:
         PyMouseEvent.run(self)
     except KeyboardInterrupt:
         self._writeCoordinateList()
Пример #19
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.mouse_clicks = []
Пример #20
0
 def __init__(self, mouse_event_listener):
     PyMouseEvent.__init__(self)
     self.mouse_event_listener = mouse_event_listener
Пример #21
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.mouse = PyMouse()
     self.first = True
Пример #22
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.top_left = False
     self.bottom_right = False
     print("Click the top left corner of the area to draw in..")
Пример #23
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.fibo = fibo()
Пример #24
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.print_message()
Пример #25
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.x_click_down = -1
     self.y_click_down = -1
     self.x_click_up = -1
     self.y_click_up = -1
Пример #26
0
 def __init__(self, image):
     PyMouseEvent.__init__(self)
     self.prev = PyMouse().position()
     self.lastStop = time.time()
     self.BLACK = (0, 0, 0, 255)
     self.image = image
Пример #27
0
	def __init__(self):
		PyMouseEvent.__init__(self)
		self.events = []
		self.stop_trigger = None
Пример #28
0
 def __init__(self):
     self.state = 1
     PyMouseEvent.__init__(self)
Пример #29
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.buttons = {0: False, 1: False, 2: False}
Пример #30
0
 def __init__(self):
     PyMouseEvent.__init__(self)
Пример #31
0
 def __init__(self, capture=False):
     PyMouseEvent.__init__(self, capture=capture)
     self.mclicked = 0
     self.MyMouse = None
     if capture:  #if capture .. make mouse stay at same place
         self.MyMouse = PyMouse()
Пример #32
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.coords = MouseCoords()
Пример #33
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.x, self.y = None, None
Пример #34
0
    def __init__(self):
        PyMouseEvent.__init__(self)

        # list of listener functions
        self.moveListeners = []
Пример #35
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.phase = 0
     print "The bot needs to know where the game board is."
     print "Please mark it by pressing LMB somewhere inside game board border's *upper left corner*."
Пример #36
0
	def __init__(self):
		PyMouseEvent.__init__(self)
Пример #37
0
 def reset(self):
     PyMouseEvent.__init__(self, capture=False, capture_move=False)
     self.m = PyMouse()
     self.timer = Timer()
     self.moves = []
     self.stopped = False
Пример #38
0
 def __init__(self, stop_action):
     PyMouseEvent.__init__(self)
     self.clicks = 0
     self.topleft = (0, 0)
     self.botright = (0, 0)
     self.stop_action = stop_action
Пример #39
0
 def __init__(self):
     PyMouseEvent.__init__(self, capture=True)
     self.curSong = 0
     self.numSongs = 4
     self.songs = ["CHAIR", "TEDDYBEAR", "BICYCLE", "DOOR"]
Пример #40
0
	def __init__(self):
		PyMouseEvent.__init__(self)

		os.system('~/Documents/scripts/general/sh/shift.sh 1 2')
		self.current_desktop = self.get_current_desktop()
		self.update_windows()
Пример #41
0
 def __init__(self, mouse_activity_event):
     PyMouseEvent.__init__(self)
     self.mouse_activity_event = mouse_activity_event
Пример #42
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.top_left = []
     self.bottom_right = []
Пример #43
0
 def stop(self):
     print(self.topleft[0], self.topleft[1])
     print(self.botright[0], self.botright[1])
     self.stop_action(self)
     PyMouseEvent.stop(self)
Пример #44
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.mouse = PyMouse()
     self.first = True
 def __init__(self,wLocation):
     PyMouseEvent.__init__(self)
     self._startTime = time.time()
     self._lastEventTime = self._startTime
     self._writeLocation = wLocation
     self._coordinateList = []
Пример #46
0
 def __init__(self):
     print("Started Capturing Cursor...")
     PyMouseEvent.__init__(self)
Пример #47
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.fibo = fibo()
Пример #48
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.history = []