LDTP  3.5.0
 All Pages
generatemouseevent

Syntax

generatemouseevent(x, y [,'<options>'])

Description

Functionality of generatemouseevent, generates the default(left click) or specified mouse event in the given X and Y coordinates.

Note

This functionality depends on screen resolution / coordinates. Also the event will be generated on the currently focused window.

Options

b1c - Left button click

b2c - Middle button click

b3c - Right button click

b1d - Left button double click

b2d - Middle button double click

b3d - Right button double click

abs - absolute motion

rel - relative motion

b1p - Button 1 press

b1r - Button 1 release

b3p - Button 3 press

b3r - Button 3 release

ImplementationDetails

Used SPI_generateMouseEvent to generate the mouse events.

Return values
Returns1 on success, LdtpExecutionError exception will be thrown on failure

Refer: Linux: http://cgit.freedesktop.org/ldtp/ldtp2/tree/ldtpd/mouse.py

Mac: https://github.com/ldtp/pyatom/blob/master/atomac/ldtpd/mouse.py

Windows: https://github.com/ldtp/cobra/blob/master/Ldtpd/Mouse.cs

Example

generatemouseevent(100, 200)

generatemouseevent(100, 200, "b1d") # Generate double click event

Author
Nagappan Alagappan nagap.nosp@m.pan@.nosp@m.gmail.nosp@m..com


Linux Desktop Testing Project