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()
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))
def __init__(self, logdata): PyMouseEvent.__init__(self) self.logdata = logdata self.mouse_x = 0 self.mouse_y = 0 self.lastMoveTime = time.time()
def __init__(self): PyMouseEvent.__init__(self) self.MousePositions = [] self.NumPositions = 0 # Instantiate an mouse object self.mouse = PyMouse()
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)
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
def __init__(self, object2notify): """Create MouseListener. :param object2notify: MainTimer object :type object2notify: MainTimer """ CommonListener.__init__(self, object2notify) PyMouseEvent.__init__(self)
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()
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()
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()
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
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
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()
def __init__(self): PyMouseEvent.__init__(self) self.mouse_clicks = []
def __init__(self, mouse_event_listener): PyMouseEvent.__init__(self) self.mouse_event_listener = mouse_event_listener
def __init__(self): PyMouseEvent.__init__(self) self.mouse = PyMouse() self.first = True
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..")
def __init__(self): PyMouseEvent.__init__(self) self.fibo = fibo()
def __init__(self): PyMouseEvent.__init__(self) self.print_message()
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
def __init__(self, image): PyMouseEvent.__init__(self) self.prev = PyMouse().position() self.lastStop = time.time() self.BLACK = (0, 0, 0, 255) self.image = image
def __init__(self): PyMouseEvent.__init__(self) self.events = [] self.stop_trigger = None
def __init__(self): self.state = 1 PyMouseEvent.__init__(self)
def __init__(self): PyMouseEvent.__init__(self) self.buttons = {0: False, 1: False, 2: False}
def __init__(self): PyMouseEvent.__init__(self)
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()
def __init__(self): PyMouseEvent.__init__(self) self.coords = MouseCoords()
def __init__(self): PyMouseEvent.__init__(self) self.x, self.y = None, None
def __init__(self): PyMouseEvent.__init__(self) # list of listener functions self.moveListeners = []
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*."
def reset(self): PyMouseEvent.__init__(self, capture=False, capture_move=False) self.m = PyMouse() self.timer = Timer() self.moves = [] self.stopped = False
def __init__(self, stop_action): PyMouseEvent.__init__(self) self.clicks = 0 self.topleft = (0, 0) self.botright = (0, 0) self.stop_action = stop_action
def __init__(self): PyMouseEvent.__init__(self, capture=True) self.curSong = 0 self.numSongs = 4 self.songs = ["CHAIR", "TEDDYBEAR", "BICYCLE", "DOOR"]
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()
def __init__(self, mouse_activity_event): PyMouseEvent.__init__(self) self.mouse_activity_event = mouse_activity_event
def __init__(self): PyMouseEvent.__init__(self) self.top_left = [] self.bottom_right = []
def stop(self): print(self.topleft[0], self.topleft[1]) print(self.botright[0], self.botright[1]) self.stop_action(self) PyMouseEvent.stop(self)
def __init__(self,wLocation): PyMouseEvent.__init__(self) self._startTime = time.time() self._lastEventTime = self._startTime self._writeLocation = wLocation self._coordinateList = []
def __init__(self): print("Started Capturing Cursor...") PyMouseEvent.__init__(self)
def __init__(self): PyMouseEvent.__init__(self) self.history = []