RanorexRanorex Documentation
Press Method (sequence, keyPressTime)
NamespacesRanorexKeyboardPress(String, Duration)
Presses the keys specified by sequence.
Declaration Syntax
C#Visual BasicVisual C++
public static void Press(
	string sequence,
	Duration keyPressTime
)
Public Shared Sub Press ( _
	sequence As String, _
	keyPressTime As Duration _
)
public:
static void Press(
	String^ sequence, 
	Duration^ keyPressTime
)
Parameters
sequence (String)
A sequence of characters and escape groups that specify the keys to press.
keyPressTime (Duration)
The key press time.
Remarks
Each key is represented by a single character or an escape group. To specify a single keyboard character, use the character itself (e.g. use "aBc" to press the keys A, B+Shift, and C after another). Only the '{' character has a special meaning and needs to be escaped by preceding it with another '{' (specify "{{" to issue a '{' key press).

Escape groups, signaled by braces "{}", may be used to produce a key action with any of the keys specified by the Keys enumeration. "{Z}" means that the 'z' key should be pressed, and "{return}" or "{enter}" that the Return key is to be pressed.

Additionally, in an escape group you can specify a modifier that determines whether the key should be hold down (e.g. {CONTROL down}), released (e.g. {shift up}), or pressed a number of times (e.g. {z 3}). In an escape group, key name and modifier must be separated by a single shift character.

The keys A to Z set the key modifiers (ALT, CTRL, SHIFT) and in particular the shift key depending on their case, even if used in an escape group. If these keys should not modify the shift key state, wrap them into an escape group and add "key" to the character, e.g. "{Rkey}" to press the R key without changing the shift key state.

Assembly: Ranorex.Core (Module: Ranorex.Core) Version: 3.2.3.16825 (3.2.3.16825)