Pressing a key

i have a requirement where I want to press a key for a particular duration… How to do that…?


1 Like

You could get UiPath to run a powershell script that does this. I think something like this should work:

1). Type into activity --> “[d(shift)]”

2). Delay activity --> duration 00:00:20

3). Type into activity --> “[u(shift)]”

This will press down on the shift key, delay for 20 seconds, then release the shift key


That is not working for non-special keys like “A” :confused:

String.Join("", Enumerable.Repeat("[d(shift)] [u(shift)]",20))
cheers @Adrian_Vigdal

1 Like

@Adrian_Vigdal Why would you need to hold the “A” key down for a specified amount of time? Generally the non-special keys are used for a specific amount of characters or as part of a hotkey. If you give an example of a business case I could try to help think of a way to achieve it