6ae5110099b373fa78aa3489488ded56d0aece7c
[yaffs-website] / vendor / jcalderonzumba / gastonjs / docs / api / commands / mouse / mouse_event.md
1 mouse_event
2 ===========
3
4 This command allows you to send a mouse event to PhantomJS on a given page and element.
5
6 Allowed mouse events are:
7
8 * mouseup
9 * mousedown
10 * mousemove
11 * doubleclick
12 * click
13
14 **TODO: add link to find command documentation**
15
16 ##Command Request
17 ```json
18 {
19     "name": "mouse_event",
20     "args": [1, 0, "mousemove"]
21 }
22 ```
23 A successful mouse_event command has the following response:
24 ##Command Response
25 ```json
26 {
27     "response": {
28         "position": {
29             "x": 165,
30             "y": 59
31         }
32     }
33 }
34 ```
35 Where **x** and **y** are the coordinates where the mouse_event was done.
36
37 You need coordinates to click because that is how PhantomJS works, for more info check [PhantomJS native events](http://phantomjs.org/api/webpage/method/send-event.html).