Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for new scroll syntax #3

Merged
merged 1 commit into from
Mar 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions _posts/docs/2016-10-12-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,27 +283,27 @@ var mouse = robot.getMousePos();
console.log("Mouse is at x:" + mouse.x + " y:" + mouse.y);
{% endhighlight %}

## scrollMouse(magnitude, direction)
## scrollMouse(x, y)

Scrolls the mouse either up or down.
Scrolls the mouse in any direction.

**Arguments**

**Argument** | **Description** | **Default**
--------|-----------------|-------------
`magnitude` | The amount to scroll. | None
`direction` | Accepts down or up. | None
`x` | The magnitude and direction of the scroll left and right. Left is negative. | None
`y` | The magnitude and direction of the scroll up and down. Down is negative. | None

**Examples**

{% highlight javascript %}
var robot = require("robotjs");

robot.scrollMouse(50, "up");
robot.scrollMouse(50, 0);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be robot.scrollMouse(-50, 0); for up?


setTimeout(function()
{
robot.scrollMouse(50, "down");
robot.scrollMouse(50, 0);
}, 2000);
{% endhighlight %}

Expand Down