Ctrl + Left Click

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Ctrl + Left Click

Post by atom » Fri Feb 13, 2009 7:23 pm

Hiya

There is a Button that i need to click on while holding down the Left Ctrl key
Is that possible in Ranorex, seems you can only click with a specific mouse button, but no while a key is being pressed.

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Post by Support Team » Mon Feb 16, 2009 9:52 am

There is no method in the Adapter (since keyboard input is always global and not specific to an element), but there are methods in the Keyboard class which provide that functionality: the Keyboard.Down and Keyboard.Up methods.

Code: Select all

Keyboard.Down(System.Windows.Forms.Keys.ControlKey);
button.Click();
Keyboard.Up(System.Windows.Forms.Keys.ControlKey);
Regards,
Alex
Ranorex Support Team