How to record mouse clicks using Ranorex API?

Class library usage, coding and language questions.
Arny
Posts: 1
Joined: Fri Oct 21, 2011 1:27 am

How to record mouse clicks using Ranorex API?

Post by Arny » Fri Oct 21, 2011 1:30 am

Hello,
I am developing user activity recorder with some specific features.
I use Python .Net and Ranorex API.
My question is how can I handle and record mouse events particularly (left click, right click and double clicks).
I know that Ranorex has the method: MouseEventHandler.
However, API documentation does not show how to use this method to hook to mouse events.
Could you please elaborate on this and post some code snippet for mouse click recording (how it is performed in Ranorex Recorder?)
Thank you in advance.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to record mouse clicks using Ranorex API?

Post by Support Team » Fri Oct 21, 2011 1:03 pm

Hi,

You can create Event Handlers which catches the thrown Mouse Events, therefore take a look at the following site (Ranorex Namespace->Mouse->Events).

Regards,
Markus
Ranorex Support Team
.
Image

[email protected]
Posts: 1
Joined: Fri Oct 21, 2011 1:09 am

Re: How to record mouse clicks using Ranorex API?

Post by [email protected] » Tue Oct 25, 2011 9:29 pm

Hi,
Thank you for you response.
Now, I can use Mouse.Up or Mouse.Down event handlers.
However, these events only refer to one time mouse click. Do you provide Double Click events?
I've tried MouseEventArgs.Clicks, but its value is always one (does not matter whether it was dbl click or single click).
To sum up: how can I trace double click events?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to record mouse clicks using Ranorex API?

Post by Support Team » Thu Oct 27, 2011 12:49 pm

Hi,

There is no double click event itself - it's a combination of some mouse down/up events.

You have to define this event on your own (combining these down/up events in a reasonable way), using the information which are proviced by the classes Mouse and MouseEventArgs.

Maybe this link will help you to write this Event http://www.codeproject.com/KB/system/gl ... mhook.aspx.

Regards,
Martin
Ranorex Support Team
.
Image