Keyboard.Press Method

Ask general questions here.
sunitha
Posts: 24
Joined: Thu May 14, 2009 2:06 pm

Keyboard.Press Method

Post by sunitha » Wed May 27, 2009 2:23 pm

I need to press Ctrl+PgDwn, the code i used is Keyboard.Press("^{PGDN}");
I'm getting an error saying "Unable to process the expression"

Can you suggest how to press the Ctrl+PgDn Key Event :)

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Post by Ciege » Wed May 27, 2009 4:15 pm

Try this:

Code: Select all

Keyboard.Press("{ControlKey down}{PageDown}{ControlKey up}");
Check out this link for acceptible keys for the Keyboard.Press method:
http://msdn.microsoft.com/en-us/library ... .keys.aspx

thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

Post by thangavel » Fri Jun 12, 2009 9:12 am

You can try this also

Code: Select all

Keyboard.Down(Keys.ControlKey);
Keyboard.Down(Keys.PageUp);
Keyboard.up(Keys.ControlKey);
Keyboard.Up(Keys.PageUp);
Last edited by thangavel on Fri Aug 14, 2009 2:59 pm, edited 1 time in total.
Regards,
Thangavel.S

thangavel
Posts: 50
Joined: Tue Jun 09, 2009 6:48 am
Contact:

Re: Keyboard.Press Method

Post by thangavel » Fri Aug 14, 2009 2:57 pm

You can try this also.. but it is lengthy code.

Code: Select all

Keyboard.Down(Keys.ControlKey);
Keyboard.Down(Keys.PageDown);
Keyboard.Up(Keys.PageDown);
Keyboard.Up(Keys.ControlKey);
The following approach is sounds good

Code: Select all

Keyboard.Press("{ControlKey down}{PageDown}{ControlKey up}");
Regards,
Thangavel.S

Rakesh123
Posts: 63
Joined: Thu Oct 28, 2010 2:18 pm

Re: Keyboard.Press Method

Post by Rakesh123 » Thu Jan 27, 2011 1:44 pm

How to Press Alphabetics in Ranorex............

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

Re: Keyboard.Press Method

Post by Support Team » Thu Jan 27, 2011 1:56 pm

Hi,

for Alphabetics you can use
Keyboard.Press(Keys.A);
Keyboard.Press(Keys.B);
Keyboard.Press(Keys.C);
Keyboard.Press(Keys.D);
...
See following link for more information about Keys enumeration:
http://msdn.microsoft.com/en-us/library ... .keys.aspx

Regards,
Tobias
Support Team
.
Image

fabdic
Posts: 2
Joined: Mon Jul 21, 2014 9:47 am

Re: Keyboard.Press Method

Post by fabdic » Thu Aug 27, 2015 8:55 am

Rakesh123 wrote:How to Press Alphabetics in Ranorex............
Ranorex.Keyboard.Press("This letters will be pressed");