public static InputApp GetInputApp(AppInfo appInfo) { // ToDo: Refactor the way check for special cases is performed in ActionHandl InputApp inputApp = InputApp.Normal; // Special case for the Microsoft Edge if ((appInfo.ProcessName.StartsWith("applicationframehost", StringComparison.CurrentCultureIgnoreCase) && (!string.IsNullOrWhiteSpace(appInfo.Domain) || appInfo.Title.StartsWith("skype", StringComparison.CurrentCultureIgnoreCase))) || appInfo.ProcessName.StartsWith("microsoftedge", StringComparison.CurrentCultureIgnoreCase)) { inputApp = InputApp.Edge; } else if (appInfo.Title.StartsWith("skype", StringComparison.CurrentCultureIgnoreCase)) { inputApp = InputApp.Skype; } return(inputApp); }
/// <summary> /// Simulate input string into cached file /// </summary> /// <param name="text">String for input</param> protected async Task SimulateInput(string text) { InputApp inputApp = InputHelper.GetInputApp(currentAppInfo); await inputHandler.SimulateKeyboardInputAsync(inputCache, text, inputApp); }