/// <summary> /// Activates the on-screen keyboard. /// </summary> /// <returns> /// true if the on-screen keyboard could be activated, false otherwise. /// </returns> public static bool Show() { string executablePath = OnScreenKeyboard.GetExecutablePath(); if (executablePath == null) { Trace.TraceWarning($"On-screen keyboard not available"); return(false); } ProcessStartInfo startInfo = new ProcessStartInfo(executablePath); startInfo.ErrorDialog = false; startInfo.UseShellExecute = true; using (Process process = Process.Start(startInfo)) { if (process == null) { Trace.TraceWarning($"On-screen keyboard failed to start: {executablePath}"); } return(process != null); } }
/// <summary> /// Gets whether the on-screen keyboard is available or not. /// </summary> /// <returns> /// true if the on-screen keyboard is available, false otherwise. /// </returns> public static bool IsAvailable() => OnScreenKeyboard.GetExecutablePath() != null;