Input the Function Key

Mar 1, 2014 at 8:57 AM
How i can input the function key like F1 ??
Mar 1, 2014 at 10:57 AM
For example,
(start-process calc -pass | get-uiawindow).Keyboard.KeyPress([WindowsInput.Native.VirtualKeyCode]::F1)
Mar 1, 2014 at 11:14 AM
Thanks for your help
May 10, 2014 at 9:00 AM
May 10, 2014 at 1:14 PM
first of all, the source of names of key codes is up to the author of the InputSimulator framework. He made names similar to vendor's, however without some parts like "VK_".
For example, the vendor's list is here: It contains a bug with both Alt buttons! Look at the upper comment.
A better list is this.

As the author of InputSimulator cut out some parts, the algorithm of search is
1) found the key of your interest on the pages following the first or the second link.
2) try to find it in the enum: [WindowsInput.Native.VirtualKeyCode]::
3) if you failed, cut out the "VK_" part and try to find it again
I'll put a table on the wiki within several days, it's a too ugly algorithm to find keys. :)

The sample below is tested on Far ( By pressing Alt+F, the active string is the first the starts with F:
$wnd = Get-UiaWindow -n *far*