Skip to content

SendKey.cs

Avrigeanu Laurian edited this page Apr 11, 2023 · 1 revision

SendKey(Key key, IPage page, bool activatePage = false)

Sends a key press to a page.

Parameters

  • key : A Key enum value representing the key to press.
  • page : An IPage object representing the page to send the key press to.
  • activatePage : A bool value indicating whether to activate the page before sending the key press. Default is false.

Returns

None.

Remarks

This method sends a key press to the provided IPage object by calling its Keyboard.PressAsync method with the string representation of the provided key enum value. If the activatePage parameter is set to true, the method also calls the BringToFrontAsync method of the provided IPage object to activate the page before sending the key press. The method blocks until the key press has been successfully executed before returning. The Log class is used to write an information message to the log indicating that the key has been pressed.

Clone this wiki locally