Page 1 of 1

Problem with mouse buttons

Posted: 16 Apr 2012, 13:54
by donydony2009
My problem is that i don't really understand how this buttons work. I have this simple code:

Code: Select all

Execution.pause(2000);
var key = new Keyboard();
var key1 = new Mouse();
var i=1;
var j=1;
var z=1;
for(i=1;i<=8;i++)
{
	key.pressKey(i);
	key.releaseKey(i);
	for(j=1;j<=4;j++)
	{
		
		for(z=1;z<=400;z++)
		{
			key1.click();
			Execution.pause(100);
		}
		key.pressKey(9);
		key.releaseKey(9);
		key1.press("RightButton");
		Execution.pause(8000);
		key1.release("RightButton");
		Console.print(j);
		key.pressKey(i);
		key.releaseKey(i);
	}
}


But for some reason at key1.press("RightButton"); is still pressing left button. Would you explain to me where i am wrong please?

Re: Problem with mouse buttons

Posted: 16 Apr 2012, 23:21
by Jmgr
Hm... It seems that there is a regression here. This was working before, but in the latest version I also get a freeze under Linux, and under Windows I cannot get a right click, event when setting 2 as the button. (2 is the enumeration value for a right click)

Unfortunately I don't have much time now to correct this. Are you using Windows or Linux ?

Re: Problem with mouse buttons

Posted: 17 Apr 2012, 00:16
by donydony2009
Windows. Thx for your reply. I was thinking that i do something wrong. It isn't working as a code but as a action is working perfectly. I like to do it as a code but... if it don't work i'll do it with actions.

Re: Problem with mouse buttons

Posted: 17 Apr 2012, 07:59
by Jmgr
The problem is that the vast majority of people use mostly the actions and not the (JavaScript) Code, so that part is less tested. Thanks for pointing this out, I will correct this as soon as possible, but you should use the actions in the meantime.

Since you know programming don't hesitate to use the procedure actions, I haven't got much feedback about them since they were published.

Re: Problem with mouse buttons

Posted: 17 Apr 2012, 16:29
by donydony2009
Oh i didn't see the procedure thing:> is a lot better with that. All is organized:>. I'll test it. If is any problem i'll post here.