/// <summary> /// Types a key while a set of modifier keys are being pressed. Modifer keys /// are pressed in the order specified and released in reverse order. /// </summary> /// <param name="key">Key to type.</param> /// <param name="modifierKeys">Set of keys to hold down with key is typed.</param> private static void Type(Key key, Key[] modifierKeys) { foreach (Key modiferKey in modifierKeys) { Press(modiferKey); } Type(key); foreach (Key modifierKey in modifierKeys.Reverse()) { Release(modifierKey); } }