Version: 1.8.0
Mouse
The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
Every page
object has its own Mouse, accessible with page.mouse.
- mouse.click(x, y[, options])
- mouse.dblclick(x, y[, options])
- mouse.down([options])
- mouse.move(x, y[, options])
- mouse.up([options])
#
mouse.click(x, y[, options])x
<number>y
<number>options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.delay
<number> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
Shortcut for mouse.move(x, y[, options]), mouse.down([options]), mouse.up([options]).
#
mouse.dblclick(x, y[, options])x
<number>y
<number>options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.delay
<number> Time to wait betweenmousedown
andmouseup
in milliseconds. Defaults to 0.
Shortcut for mouse.move(x, y[, options]), mouse.down([options]), mouse.up([options]), mouse.down([options]) and mouse.up([options]).
#
mouse.down([options])options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.
Dispatches a mousedown
event.
#
mouse.move(x, y[, options])x
<number>y
<number>options
<Object>steps
<number> defaults to 1. Sends intermediatemousemove
events.
Dispatches a mousemove
event.
#
mouse.up([options])options
<Object>button
<"left"|"right"|"middle"> Defaults toleft
.clickCount
<number> defaults to 1. See UIEvent.detail.
Dispatches a mouseup
event.