RanorexRanorex Documentation
Press Method (focusTarget, sequence)
NamespacesRanorexKeyboardPress(Element, String)
Presses the keys specified by sequence.
Declaration Syntax
C#Visual BasicVisual C++
public static void Press(
	Element focusTarget,
	string sequence
)
Public Shared Sub Press ( _
	focusTarget As Element, _
	sequence As String _
)
public:
static void Press(
	Element^ focusTarget, 
	String^ sequence
)
Parameters
focusTarget (Element)
The element to set the focus to, if possible, before entering the sequence.
sequence (String)
A sequence of characters and escape groups that specify the keys to press.
Remarks
Each key is repesented 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, signalled 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)