{"action":"created","issue":{"url":"https://api.github.com/repos/n1k0/casperjs/issues/1162","labels_url":"https://api.github.com/repos/n1k0/casperjs/issues/1162/labels{/name}","comments_url":"https://api.github.com/repos/n1k0/casperjs/issues/1162/comments","events_url":"https://api.github.com/repos/n1k0/casperjs/issues/1162/events","html_url":"https://github.com/n1k0/casperjs/issues/1162","id":58411921,"number":1162,"title":"CasperJs right click not available","user":{"login":"badriub","id":3220659,"avatar_url":"https://avatars.githubusercontent.com/u/3220659?v=3","gravatar_id":"","url":"https://api.github.com/users/badriub","html_url":"https://github.com/badriub","followers_url":"https://api.github.com/users/badriub/followers","following_url":"https://api.github.com/users/badriub/following{/other_user}","gists_url":"https://api.github.com/users/badriub/gists{/gist_id}","starred_url":"https://api.github.com/users/badriub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badriub/subscriptions","organizations_url":"https://api.github.com/users/badriub/orgs","repos_url":"https://api.github.com/users/badriub/repos","events_url":"https://api.github.com/users/badriub/events{/privacy}","received_events_url":"https://api.github.com/users/badriub/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-20T21:19:53Z","updated_at":"2015-03-06T08:17:21Z","closed_at":null,"body":"As far as I could notice there is no support available for 'right click' in casperJs. Any possibility this can be added? \r\n\r\nI tried my hand at it by modifying the mouse.js as below but it doesn't work. PhantomJs supports the right click with an additional argument mouseButton as seen [here](https://github.com/ariya/phantomjs/blob/12870d90ad995d6704288690125c07bb0d8bedd9/src/webpage.cpp)\r\nif mouseButton = \"right\", it assumes right click. \r\n\r\n\r\n\r\nAny suggestions?\r\n\r\n```javascript\r\n function processEvent(type, args, mouseButton) {\r\n        casper.log(\"Mouse.processEvent(): mouseButton : \" +mouseButton, \"debug\");\r\n        casper.log(\"Mouse.processEvent(): args length: \" +args.length, \"debug\");\r\n        if (!utils.isString(type) || supportedEvents.indexOf(type) === -1) {\r\n            throw new CasperError('Mouse.processEvent(): Unsupported mouse event type: ' + type);\r\n        }\r\n        if (emulatedEvents.indexOf(type) > -1) {\r\n            casper.log(\"Mouse.processEvent(): no native fallback for type \" + type, \"warning\");\r\n        }\r\n\r\n        args = slice.call(args); // cast Arguments -> Array\r\n        casper.emit('mouse.' + type.replace('mouse', ''), args);\r\n        switch (args.length) {\r\n            case 0:\r\n                throw new CasperError('Mouse.processEvent(): Too few arguments');\r\n            case 1:\r\n                // selector\r\n                if(mouseButton) {\r\n                        var array = computeCenter(args[0]);\r\ncasper.log(\"Mouse.processEvent(): array: \" +array);\r\n                        casper.page.sendEvent(type, array[0], array[1], mouseButton);\r\n                } else {\r\n                        casper.page.sendEvent.apply(casper.page, [type].concat(computeCenter(args[0])), mouseButton);\r\n                }\r\n                break;\r\n            case 2:\r\n                // coordinates\r\n                if (!utils.isNumber(args[0]) || !utils.isNumber(args[1])) {\r\n                    throw new CasperError('Mouse.processEvent(): No valid coordinates passed: ' + args);\r\n                }\r\n                casper.log(\"Mouse.processEvent(): mouseButton : \" +mouseButton, \"debug\");\r\n                casper.page.sendEvent(type, args[0], args[1], mouseButton);\r\n                break;\r\n            default:\r\n                throw new CasperError('Mouse.processEvent(): Too many arguments');\r\n        }\r\n    }\r\n\r\n    this.rightclick = function rightclick() {\r\n        processEvent('click', arguments, \"right\");\r\n    };\r\n```"},"comment":{"url":"https://api.github.com/repos/n1k0/casperjs/issues/comments/77522105","html_url":"https://github.com/n1k0/casperjs/issues/1162#issuecomment-77522105","issue_url":"https://api.github.com/repos/n1k0/casperjs/issues/1162","id":77522105,"user":{"login":"paazmaya","id":369881,"avatar_url":"https://avatars.githubusercontent.com/u/369881?v=3","gravatar_id":"","url":"https://api.github.com/users/paazmaya","html_url":"https://github.com/paazmaya","followers_url":"https://api.github.com/users/paazmaya/followers","following_url":"https://api.github.com/users/paazmaya/following{/other_user}","gists_url":"https://api.github.com/users/paazmaya/gists{/gist_id}","starred_url":"https://api.github.com/users/paazmaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paazmaya/subscriptions","organizations_url":"https://api.github.com/users/paazmaya/orgs","repos_url":"https://api.github.com/users/paazmaya/repos","events_url":"https://api.github.com/users/paazmaya/events{/privacy}","received_events_url":"https://api.github.com/users/paazmaya/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T08:17:21Z","updated_at":"2015-03-06T08:17:21Z","body":"Thank you for adding #1169.\r\n\r\nThe SlimerJS counterpart just needs to be tested, could not find anything with a quick look at its documentation..."}}