Hold down a key while clicking and dragging the mouse : Automation API

Hold down a key while clicking and dragging the mouse

Class library usage, coding and language questions.

Hold down a key while clicking and dragging the mouse

Postby aldo.longhi » Thu Mar 18, 2010 2:26 am

Hello.

I am using Ranorex.Net v1.4 on Windows (Win2000, WinXP, Win7) machines. I have a need to perform the following sequence of actions:

1) Press and hold a key on the keyboard (Ctrl)
2) Click and drag with a mouse button (left button for now, but possibly other buttons later)
3) Release the keyboard key

I will also need to do a similar sequence with merely a click (no drag) in step 2.

I have not found any way to do this with the 1.4 (.Net) API. I have seen the methods Keyboard.Down and Keyboard.Up in the 2.X API, but I do not have that version of Ranorex (yet).

Is there any way to perform this sequence using Ranorex.Net v1.4?

Thank you.
aldo.longhi
 
Posts: 4
Joined: Thu Mar 18, 2010 2:19 am

Re: Hold down a key while clicking and dragging the mouse

Postby Support Team » Thu Mar 18, 2010 12:38 pm

Hi,

Yes, it is possible and the Ranorex Recorder 1.4 (or above) should be able to record drag & drop operations. If you don't use the recorder, you need to send keyboard inputs to the application to hold down a key (e.g. "{CTRLDOWN}"); then do the drag/drop mouse action; then release the key again (e.g. "{CTRLUP}". You send keys to an application using the the Application.SendKeys method:
http://www.ranorex.com/Documentation/Ne ... ndKeys.htm

Regards,
Alex
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests