TX Text Control .NET Server

SendKeyPress Method

Method|Introduced in 21.0
Namespace
TXTextControl.ServerVisualisation
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Server.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.Server.dll

Description

Informs the view generator about a key press event.

Syntax

public bool SendKeyPress(int keyChar, UserInput.ModifierKeys modifierKeys);

Parameters

ParameterDescription
keyChar

Specifies the translated character code for the pressed key.

modifierKeys

Specifies modifier keys. It can be a combination of the ServerVisualization.UserInput.ModifierKeys values.

Return Value

If the event has been handled, the method returns true. Otherwise, it returns false.

Examples

The following example uses Send Key Press in a focused User Input workflow.

if (userInput.SendKeyPress(10, TXTextControl.ServerVisualisation.UserInput.ModifierKeys.Shift))
{
    Console.WriteLine("Send Key Press completed successfully.");
}