How to send hotkeys (tab) several times, (spacebar)

uiautomation
studio
hotkey

#1

Hi everyone!
Is there a simple way to send tab and spacebar several times as a hotkey?
I couldn’t find something like Counter :frowning:


#2

Yes, you can add a Type Into object (Ui Automation - Element - Keyboard).

And you can add this:
"[k(tab)][k(space)]"

Add how many [k(tab)] you need and spaces also.

If you want to down press a key and release it you would use

[d(ctrl)] To downpress it and maintain it
[u(ctrl)] To Release it.

Let me know if you need anything else.


#3

I don’t think there is a [k(space)], but I could be wrong. I normally use the character space.
For example… "[k(tab)] "


#4

If you want to repeat keystroke string multiple times, this might be useful:

String.Join("", Enumerable.Repeat("[d(alt)] [u(alt)]",20))

So that will repeat the string 20 times in the TypeInto.


Multiple hot key press
Hotkeys for 10 sec
#5

There is no space key how I said earlier, you are right Clayton :smiley:


#6

Thank you! You helped me a lot!


#7

Thank you for your help!


#8

Guys! Similar to this post, I am encountering a scenario where I need to find the count value at which the cursor will be put on specific field.

For example - I have 5 fields (Name, Age, Salary, DOB & Occupation) - Cursor would initially be in the “Name” field. When I press tab for the first time (Cnt=1), it would move to “Age” field, When I press tab again (2nd time), it would be in “Salary” field and so on. But then what I would like to know is the total number of tabs possible in screen without repeating/navigating to the same elements.

For example - let’s say that few of the fields(Age, salary) are disabled, then tab would not take you to that field at all. In this case the total tab count would only be two whereas in first scenario, the tab count would be 5 because all fields are active. Please note that am working in citrix environment, so no option to find whether an element is enabled/ disabled. Image activity doesn’t work either


#9

@ClaytonM I am not able to understand this. I need to repeat tab hotkey 5 times after a click event where should i change in your code. Should i set your code in assign. Could you please clarify?


#10

Hi @Ula

You can simulate hotkeys with the TypeInto activity, which is faster and you can do multiple keys in a row.

So, place the repeat code in the TypeInto. The code is essentially creating a string that has multiples of the same keys (ie “[k(tab)][k(tab)][k(tab)] …”

Regards.


#11