Package lib :: Module scripting :: Class Mouse
[hide private]
[frames] | no frames]

Class Mouse

source code

Provides access to send mouse clicks

Instance Methods [hide private]
 
__init__(self, mediator) source code
 
click_relative(self, x, y, button)
Send a mouse click relative to the active window
source code
 
click_relative_self(self, x, y, button)
Send a mouse click relative to the current mouse position
source code
 
click_absolute(self, x, y, button)
Send a mouse click relative to the screen (absolute)
source code
 
wait_for_click(self, button, timeOut=10.0)
Wait for a mouse click
source code
Method Details [hide private]

click_relative(self, x, y, button)

source code 

Send a mouse click relative to the active window

Usage: mouse.click_relative(x, y, button)

Parameters:
  • x - x-coordinate in pixels, relative to upper left corner of window
  • y - y-coordinate in pixels, relative to upper left corner of window
  • button - mouse button to simulate (left=1, middle=2, right=3)

click_relative_self(self, x, y, button)

source code 

Send a mouse click relative to the current mouse position

Usage: mouse.click_relative_self(x, y, button)

Parameters:
  • x - x-offset in pixels, relative to current mouse position
  • y - y-offset in pixels, relative to current mouse position
  • button - mouse button to simulate (left=1, middle=2, right=3)

click_absolute(self, x, y, button)

source code 

Send a mouse click relative to the screen (absolute)

Usage: mouse.click_absolute(x, y, button)

Parameters:
  • x - x-coordinate in pixels, relative to upper left corner of window
  • y - y-coordinate in pixels, relative to upper left corner of window
  • button - mouse button to simulate (left=1, middle=2, right=3)

wait_for_click(self, button, timeOut=10.0)

source code 

Wait for a mouse click

Usage: mouse.wait_for_click(self, button, timeOut=10.0)

Parameters:
  • button - they mouse button click to wait for as a button number, 1-9
  • timeOut - maximum time, in seconds, to wait for the keypress to occur