コード例 #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()
コード例 #5
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()
コード例 #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)
コード例 #11
0
 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
ファイル: autoClicker.py プロジェクト: okiyama/PyAutoClicker
 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
ファイル: snap.py プロジェクト: sme3863/snapPy
	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
コード例 #16
0
 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()
コード例 #18
0
 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
ファイル: mouse_events.py プロジェクト: Python3pkg/KeyCat
 def __init__(self, mouse_event_listener):
     PyMouseEvent.__init__(self)
     self.mouse_event_listener = mouse_event_listener
コード例 #21
0
ファイル: repclick.py プロジェクト: Terrorbear/dumb-clicker
 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
ファイル: userinput_demo.py プロジェクト: gitTianxy/py-basics
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.fibo = fibo()
コード例 #24
0
ファイル: utility.py プロジェクト: jakeshi/py_sudoku
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.print_message()
コード例 #25
0
ファイル: mouse.py プロジェクト: dvranizan/mercury
 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
ファイル: record.py プロジェクト: JDongian/auter
 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
ファイル: pyMouse.py プロジェクト: MeisterXYZ/UnrealTensor
 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
ファイル: mousecapture.py プロジェクト: zlum/snacks
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.coords = MouseCoords()
コード例 #33
0
ファイル: solver.py プロジェクト: ADEHJKNTV/GraphingSolver
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.x, self.y = None, None
コード例 #34
0
ファイル: hook.py プロジェクト: minicore2/Lane-keeping
    def __init__(self):
        PyMouseEvent.__init__(self)

        # list of listener functions
        self.moveListeners = []
コード例 #35
0
ファイル: 2048bot.py プロジェクト: rafalcieslak/2048bot
 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
ファイル: tabwin_fully_python.py プロジェクト: s0la/scripts
	def __init__(self):
		PyMouseEvent.__init__(self)
コード例 #37
0
ファイル: Autoclick.py プロジェクト: Depictograph/autoclicker
 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
ファイル: spread_all_python.py プロジェクト: s0la/scripts
	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
ファイル: afk.py プロジェクト: javid-yenmin/activitywatch-old
 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
ファイル: repclick.py プロジェクト: Terrorbear/dumb-clicker
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.mouse = PyMouse()
     self.first = True
コード例 #45
0
 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
ファイル: clickonacci.py プロジェクト: 2008820/PyUserInput
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.fibo = fibo()
コード例 #48
0
 def __init__(self):
     PyMouseEvent.__init__(self)
     self.history = []