Skip to content

Commit

Permalink
Send right click as a contextmenu event
Browse files Browse the repository at this point in the history
Depends on ariya/phantomjs#13870

Fixes #125
  • Loading branch information
Artur- committed Jan 9, 2016
1 parent 4f8c27e commit 89dbb92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/inputs.js
Expand Up @@ -328,6 +328,12 @@ ghostdriver.Inputs = function () {
_mouseButtonEvent = function (session, eventType, button) {
button = button || "left";
eventType = eventType || "click";
if (button == "right" && eventType == "click") {
session.getCurrentWindow().sendEvent("contextmenu",
_mousePos.x, _mousePos.y, //< x, y
_currentModifierKeys);
return;
}
session.getCurrentWindow().sendEvent(eventType,
_mousePos.x, _mousePos.y, //< x, y
button, _currentModifierKeys);
Expand Down

0 comments on commit 89dbb92

Please sign in to comment.