cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HellitonWoo
Regular Visitor

Use keyboard keys as is, not just typing

Hi fellows,

 

I'm trying to find a way the navigate between buttons and blanks.

It is rather hard to do so when there are no keys to use, such as:

  • Left, right, up, down
  • Tab, Page-up, Page-down

And there's no explanation of "Send text as hardware keys", what does that mean?

 

Thanks!

Helliton

1 ACCEPTED SOLUTION

Accepted Solutions
adijain
Microsoft
Microsoft

@HellitonWoo The "Send Keys" Action sends keystrokes to the application that is currently active. It can either be sent in the background as a software input or can be mimicked like from a keyboard when sent as hardware keys. To simulate key-presses inside a Send Keys Action, use the following notation: {KeyCode}. where KeyCode is the capital form of the letter itself for letters A-Z. OemSemicolon for ';', Oemplus for '+', Oemcomma for ',', OemMinus for '-', OemPeriod for '.', OemQuestion for '?', Oemtilde for '~', OemOpenBrackets for '[', OemPipe for '|', etc. 

 

In your case you can use:

Capture5.JPG

Capture6.JPG

 

 

View solution in original post

12 REPLIES 12
FUS
Helper III
Helper III

I have a similar challenge.

In a window I use the right control button to navigate to next screen... and when I record my actions I get "{RControlKey}()".
However, when I replay it that part is "skipped".

In real life I might enter "Test1" then use the Right Control key and then type "Test2"
But when I run the line "Test1{RControlKey}()Test2"... the result is that on the first page it says "Test1Test2".

adijain
Microsoft
Microsoft

@HellitonWoo The "Send Keys" Action sends keystrokes to the application that is currently active. It can either be sent in the background as a software input or can be mimicked like from a keyboard when sent as hardware keys. To simulate key-presses inside a Send Keys Action, use the following notation: {KeyCode}. where KeyCode is the capital form of the letter itself for letters A-Z. OemSemicolon for ';', Oemplus for '+', Oemcomma for ',', OemMinus for '-', OemPeriod for '.', OemQuestion for '?', Oemtilde for '~', OemOpenBrackets for '[', OemPipe for '|', etc. 

 

In your case you can use:

Capture5.JPG

Capture6.JPG

 

 

Hello @FUS , please utilize Test1{RControlKey}Test2 for your case.

Thanks @adijain for the tip... but it didn't work.... {RControlKey} just getting skipped... even if I send it as "Hardware keys".

Even tried to use screenrecord to get the "{RControlKey}" so I know it's the same... but still doesn't work.


Then I tried others like {Tab}, {F11} & {Enter}... and those seem to work just as expected.

 

I wonder if it has anything to do with the system I'm using, but since everything else works, why would this one key not work?

@FUS I found this page, which seems explaining all the key references described by @adijain 

https://referencesource.microsoft.com/#windowsbase/Base/System/Windows/Input/Key.cs,e89a228c9dc1bd2c...

 

You can try these:

{RightCtrl}

 

 

Thanks for the tip @HellitonWoo.
But unfortunately didn't "{RightCtrl}" work either... it just printed it out on the screen as text. 😞

Hello @FUS  I am sorry to hear that but {RControlKey} is the correct keycode to send right control key. Could you try adding a wait time after the control key is sent? You can do that within send keys action by using this key code {Delay 1000} - this will allow you to "wait" for 1 second prior to sending the rest keystrokes that follow this modifier. I would also suggest using just the key code {ControlKey} for sending any of the control keystroke, and see if that works for your use case. 

Hi @adijain.
It didn't work, but I did try to use Crtl in word where it worked, so I tried other "specialkeys" in the application which worked.
So I decided to look deeper into the application and found out that the PC key (Right Ctrl) uses a function for "Enter" and so did (Keypad Enter).


With some experimenting I found out that {Keypad} had the desired effect... even though I'm using a laptop without a keypad.

Mravikumar4
Frequent Visitor

I also have similar issue. Can i have syntax for "CTRL+Home"?

{Control}({Home})

 

For special keys, parenthesis identify a hold down for whatever is inside it, so '{Control}{Home} is pressing Control, then pressing Home, but by putting Home in parenthesis after Control, it is Control + Home.

 

Good luck!

Mravikumar4
Frequent Visitor

Hi Michael,

 

Thanks for your response. I tried with same syntax, but it's doing only home function. not functioning as CTRL+Home.

Test, selected cell L39.  By pressing Home, it goes to A39, by pressing Control + Home, it goes to A1.

 

Test 1, successful; it went to A39:

MichaelAnnis_0-1641311352020.png

 

Reset back to L39

 

Test 2, successful; it went to A1:

MichaelAnnis_1-1641311443219.png

 

Here is the inside of Send Keys:

MichaelAnnis_3-1641311479998.png

 

If it's not working, not sure what is going on.  Try focusing the window before you send keys.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,655)