How to send Ctrl + Shift + F1 to an application using submit keys

I want to send the keyboard shortcut Ctrl + Shift + F1 to the application.

But when I try to send the keys, I get an error message, error: ^+F1 not a valid key.

Code I use:

 System.Windows.Forms.SendKeys.Send("{^+F1}"); 
+8
c # winforms sendkeys
source share
1 answer

Looking at the documentation , you need to have braces around only F1. Try this to see if it works.

 System.Windows.Forms.SendKeys.Send("^+{F1}"); 

From the above link, inserting the ^ and + characters in curly braces, you send an alphabetic character.

The plus sign (+), carriage (^), percent sign (%), tilde (~) and parentheses () have special meanings for SendKeys. To indicate one of these characters, enclose it in curly braces ({})

added by barlop - explanatory note -

(from the above documentation)

 SHIFT + CTRL ^ ALT % 

and

 F1 {F1} F2 {F2} 
+12
source share

All Articles