Key Sequences

Windows Virtual PC

[Windows Virtual PC is no longer available for use as of Windows 8. Instead, use the Hyper-V WMI provider (V2).]

A key sequence string is a comma-delimited set of key identifiers which are used to simulate the key press and release sequence of a standard U.S. 101-key AT-style keyboard.

If a key identifier appears in the string without a preceding modifier, a key-pressed code is simulated, followed immediately by its corresponding key-released code. Key modifiers can be used to change this behavior.

For example, the DOWN modifier will send the key-pressed code for the following key identifier without sending the key-released code. This is useful for simulating Ctrl, Alt, and Shift keys when they are held down while other keys are being sent. To release the key, it must be included in the key string again along with a preceding UP modifier.

Key Identifiers

The following list details the valid key identifier strings.

Key identifier stringMeaning
Key_Escapethe Esc key
Key_F1the F1 key
Key_F2the F2 key
Key_F3the F3 key
Key_F4the F4 key
Key_F5the F5 key
Key_F6the F6 key
Key_F7the F7 key
Key_F8the F8 key
Key_F9the F9 key
Key_F10the F10 key
Key_F11the F11 key
Key_F12the F12 key
Key_SysReqthe SysReq key
Key_ScrollLockthe ScrollLock key
Key_Breakthe Break key
Key_LeftApostrophethe ` key
Key_1the 1 key
Key_2the 2 key
Key_3the 3 key
Key_4the 4 key
Key_5the 5 key
Key_6the 6 key
Key_7the 7 key
Key_8the 8 key
Key_9the 9 key
Key_0the 0 key
Key_Hyphenthe - key
Key_Equalsthe = key
Key_Backspacethe Backspace key
Key_Insertthe Ins key
Key_Homethe Home key
Key_PageUpthe PageUp key
Key_NumLockthe NumLock key
KeyPad_Dividethe / key on the keypad
KeyPad_Multiplythe * key on the keypad
KeyPad_Minusthe - key on the keypad
Key_Tabthe Tab key
Key_Qthe Q key
Key_Wthe W key
Key_Ethe E key
Key_Rthe R key
Key_Tthe T key
Key_Ythe Y key
Key_Uthe U key
Key_Ithe I key
Key_Othe O key
Key_Pthe P key
Key_LeftBracketthe [ key
Key_RightBracketthe ] key
Key_Backslashthe \ key
Key_Deletethe Delete key
Key_Endthe End key
Key_PageDownthe PageDown key
KeyPad_7the 7 key on the keypad
KeyPad_8the 8 key on the keypad
KeyPad_9the 9 key on the keypad
KeyPad_Plusthe + key on the keypad
Key_Athe A key
Key_Sthe S key
Key_Dthe D key
Key_Fthe F key
Key_Gthe G key
Key_Hthe H key
Key_Jthe J key
Key_Kthe K key
Key_Lthe L key
Key_SemiColonthe ; key
Key_SingleQuotethe ' key
Key_Enterthe Enter key
KeyPad_4the 4 key on the keypad
KeyPad_5the 5 key on the keypad
KeyPad_6the 6 key on the keypad
Key_LeftShiftthe Left Shift key
Key_Zthe Z key
Key_Xthe X key
Key_Cthe C key
Key_Vthe V key
Key_Bthe B key
Key_Nthe N key
Key_Mthe M key
Key_Commathe , key
Key_Periodthe . key
Key_Slashthe / key
Key_RightShiftthe Right Shift key
Key_Upthe Up key
KeyPad_1the 1 key on the keypad
KeyPad_2the 2 key on the keypad
KeyPad_3the 3 key on the keypad
KeyPad_Enterthe Enter key on the keypad
Key_LeftCtrlthe Left Ctrl key
Key_LeftWindowsthe Left Windows key
Key_LeftAltthe Left Alt key
Key_Spacethe Space key
Key_RightAltthe Right Alt key
Key_RightWindowsthe Right Windows key
Key_RightCtrlthe Right Ctrl key
Key_Applicationthe Application key
Key_Leftthe Left key
Key_Downthe Down key
Key_Rightthe Right key
KeyPad_0the 0 key on the keypad
KeyPad_DecimalPointthe . key on the keypad


Key Modifiers

The following list details the valid key modifier strings.

Key modifier stringMeaning
DOWNSend a key-pressed code for the following key identifier without sending a key-released code.
UPSend a key-released code for the following key identifier.
HOLDPause 200 milliseconds before continuing to process the remainder of the key sequence string.


Related topics




Community Additions

© 2014 Microsoft