KeyPress ToCarnacKeyPress(InterceptKeyEventArgs interceptKeyEventArgs) { var process = AssociatedProcessUtilities.GetAssociatedProcess(); if (process == null) { return(null); } // see if this process is one being filtered for Regex filterRegex; if (ShouldFilterProcess(out filterRegex) && !filterRegex.IsMatch(process.ProcessName)) { return(null); } var isLetter = interceptKeyEventArgs.IsLetter(); var inputs = ToInputs(isLetter, winKeyPressed, interceptKeyEventArgs).ToArray(); try { string processFileName = process.MainModule.FileName; ImageSource image = IconUtilities.GetProcessIconAsImageSource(processFileName); return(new KeyPress(new ProcessInfo(process.ProcessName, image), interceptKeyEventArgs, winKeyPressed, inputs)); } catch (Exception) { return(new KeyPress(new ProcessInfo(process.ProcessName), interceptKeyEventArgs, winKeyPressed, inputs));; } }
KeyPress ToCarnacKeyPress(InterceptKeyEventArgs interceptKeyEventArgs) { var process = AssociatedProcessUtilities.GetAssociatedProcess(); if (process == null) { return(null); } Debug.WriteLine("processName: " + process.ProcessName); var filterRegex = GetRegEx(); if (filterRegex != null && !filterRegex.IsMatch(process.ProcessName)) { return(null); } var isLetter = interceptKeyEventArgs.IsLetter(); var inputs = ToInputs(isLetter, winKeyPressed, interceptKeyEventArgs).ToArray(); try { string processFileName = process.MainModule.FileName; ImageSource image = IconUtilities.GetProcessIconAsImageSource(processFileName); return(new KeyPress(new ProcessInfo(process.ProcessName, image), interceptKeyEventArgs, winKeyPressed, inputs)); } catch (Exception) { return(new KeyPress(new ProcessInfo(process.ProcessName), interceptKeyEventArgs, winKeyPressed, inputs));; } }
KeyPress ToCarnacKeyPress(InterceptKeyEventArgs interceptKeyEventArgs) { var process = GetAssociatedProcess(); var isLetter = interceptKeyEventArgs.IsLetter(); var inputs = ToInputs(isLetter, winKeyPressed, interceptKeyEventArgs).ToArray(); try { string processFileName = process.MainModule.FileName; ImageSource image = IconUtilities.GetProcessIconAsImageSource(processFileName); return(new KeyPress(new ProcessInfo(process.ProcessName, image), interceptKeyEventArgs, winKeyPressed, inputs)); } catch (System.Exception) { return(new KeyPress(new ProcessInfo(process.ProcessName), interceptKeyEventArgs, winKeyPressed, inputs));; } }