Example #1
0
	def mouse_click(self, button='Left', x=None, y=None, clicks=1, interval=0):
		pyvinyl.auto_delay()
	
		if (x != None or y != None):
			pos = pyvinyl.vinyl.get_mouse_pos(self.win)

			if (x == None):
				x = pos[0]
			if (y == None):
				y = pos[1]

			pyvinyl.vinyl.move_to(self.win, x, y)
		
		clicks_num = 0
		while(clicks_num<clicks):
			if(ButtonCode[button] == ButtonCode.Left):
				pyvinyl.vinyl.left_click(self.win)
			elif(ButtonCode[button] == ButtonCode.Right):
				pyvinyl.vinyl.right_click(self.win)
			elif(ButtonCode[button] == ButtonCode.Middle):
				pyvinyl.vinyl.middle_click(self.win)
			
			if(interval>0):
				pyvinyl.sleep(interval)
			clicks_num = clicks_num + 1
Example #2
0
	def hotkey(self, *args):
		pyvinyl.auto_delay()
		for key in args:
			pyvinyl.key_down(self.win, key)

		args = args[::-1]
		for key in args:
			pyvinyl.key_up(self.win, key)
Example #3
0
	def mouse_move(self, x=None, y=None, duration=0):
		pyvinyl.auto_delay()
		
		if (x == None):
			x = 0
		if (y == None):
			y = 0

		pyvinyl.vinyl.mouse_move(self.win, x, y)
Example #4
0
	def key_up(self, code, delay = None):
		pyvinyl.auto_delay()

		if (type(code) == KeyCode):
			pyvinyl.vinyl.key_up(self.win, code.value)
		elif (type(code) == str):
			pyvinyl.vinyl.key_up(self.win, KeyCode[code].value)
		
		if (delay != None and delay > 0):
			pyvinyl.vinyl.sleep(delay)
Example #5
0
	def mouse_move_to(self, x=None, y=None, duration=0):
		pyvinyl.auto_delay()

		if (x==None or y==None):
			pos = pyvinyl.vinyl.get_mouse_pos(self.win)			
			if (x == None):
				x = pos[0]
			if (y == None):
				y = pos[1]

		pyvinyl.vinyl.mouse_move_to(self.win, x, y)
Example #6
0
	def scroll(self, delay, x=None,y=None):
		pyvinyl.auto_delay()
	
		if (x != None or y != None):
			pos = pyvinyl.vinyl.get_mouse_pos(self.win)

			if (x == None):
				x = pos[0]
			if (y == None):
				y = pos[1]

			pyvinyl.vinyl.move_to(self.win, x, y)
	
		pyvinyl.vinyl.mouse_wheel(self.win, delay)
Example #7
0
	def mouse_down(self, button='Left', x=None,y=None):
		pyvinyl.auto_delay()
	
		if (x != None or y != None):
			pos = pyvinyl.vinyl.get_mouse_pos(self.win)

			if (x == None):
				x = pos[0]
			if (y == None):
				y = pos[1]

			pyvinyl.vinyl.move_to(self.win, x, y)
	
		if(ButtonCode[button] == ButtonCode.Left):
			pyvinyl.vinyl.left_down(self.win)
		elif(ButtonCode[button] == ButtonCode.Right):
			pyvinyl.vinyl.right_down(self.win)
		elif(ButtonCode[button] == ButtonCode.Middle):
			pyvinyl.vinyl.middle_down(self.win)
Example #8
0
	def say_string(self, text, delay=None):
		pyvinyl.auto_delay()
		pyvinyl.vinyl.say_string(self.win, text)
		if (delay != None and delay > 0):
			pyvinyl.vinyl.sleep(delay)
Example #9
0
	def right_double_click(self, interval=200):
		pyvinyl.auto_delay()
	
		pyvinyl.vinyl.right_click(self.win)
		pyvinyl.vinyl.sleep(interval)
		pyvinyl.vinyl.right_click(self.win)
Example #10
0
	def middle_double_click(self, interval=200):
		pyvinyl.auto_delay()
	
		pyvinyl.vinyl.middle_click(self.win)
		pyvinyl.vinyl.sleep(interval)
		pyvinyl.vinyl.middle_click(self.win)
Example #11
0
	def right_click(self, delay = None):
		pyvinyl.auto_delay()
		pyvinyl.vinyl.right_click(self.win)

		if (delay != None and delay > 0):
			pyvinyl.vinyl.sleep(delay)
Example #12
0
	def middle_click(self, delay = None):
		pyvinyl.auto_delay()
		pyvinyl.vinyl.middle_click(self.win)

		if (delay != None and delay > 0):
			pyvinyl.vinyl.sleep(delay)
Example #13
0
	def left_up(self, delay = None):
		pyvinyl.auto_delay()
		pyvinyl.vinyl.left_up(self.win)
	
		if (delay != None and delay > 0):
			pyvinyl.vinyl.sleep(delay)