private void processChanged(ProcessChangedEvent evt) { try { string appStringToMatch = evt.Process.MainModule.FileVersionInfo.FileDescription + evt.Process.MainModule.FileVersionInfo.OriginalFilename + evt.Process.MainModule.FileVersionInfo.FileName; bool keymapFound = false; IEnumerable <JObject> applicationConfigurations = this.applicationsJson.GetValue("Applications").Children <JObject>(); foreach (JObject configuration in applicationConfigurations) { string search = configuration.GetValue("Search").ToString(); if (appStringToMatch.ToLower().Replace(" ", "").Contains(search.ToLower().Replace(" ", ""))) { this.loadKeyMap(configuration.GetValue("Keymap").ToString()); keymapFound = true; } } if (!keymapFound) { this.KeyMap.SetConfig(this.fallbackKeymapJson, this.fallbackName, this.fallbackFile); } } catch (Exception e) { Console.WriteLine("Could not change keymap config for " + evt.Process); } }
private void processChanged(ProcessChangedEvent evt) { try { string appStringToMatch = evt.Process.MainModule.FileVersionInfo.FileDescription + evt.Process.MainModule.FileVersionInfo.OriginalFilename + evt.Process.MainModule.FileVersionInfo.FileName; bool keymapFound = false; List <ApplicationSearchSetting> applicationConfigurations = KeymapDatabase.Current.getKeymapSettings().getApplicationSearchSettings(); foreach (ApplicationSearchSetting searchSetting in applicationConfigurations) { string search = searchSetting.Search; if (appStringToMatch.ToLower().Replace(" ", "").Contains(search.ToLower().Replace(" ", ""))) { this.loadKeyMap(searchSetting.Keymap); keymapFound = true; } } if (!keymapFound) { this.setKeymap(this.fallbackKeymap); } } catch (Exception e) { Console.WriteLine("Could not change keymap config for " + evt.Process); } }
private void processChanged(ProcessChangedEvent evt) { try { string appStringToMatch = evt.Process.MainModule.FileVersionInfo.FileDescription + evt.Process.MainModule.FileVersionInfo.OriginalFilename + evt.Process.MainModule.FileVersionInfo.FileName; bool keymapFound = false; IEnumerable<JObject> applicationConfigurations = this.applicationsJson.GetValue("Applications").Children<JObject>(); foreach (JObject configuration in applicationConfigurations) { string search = configuration.GetValue("Search").ToString(); if (appStringToMatch.ToLower().Replace(" ", "").Contains(search.ToLower().Replace(" ", ""))) { this.loadKeyMap(configuration.GetValue("Keymap").ToString()); keymapFound = true; } } if (!keymapFound) { this.KeyMap.SetConfig(this.fallbackKeymapJson,this.fallbackName,this.fallbackFile); } } catch (Exception e) { Console.WriteLine("Could not change keymap config for " + evt.Process); } }
private void processChanged(ProcessChangedEvent evt) { try { string appStringToMatch = evt.Process.MainModule.FileVersionInfo.FileDescription + evt.Process.MainModule.FileVersionInfo.OriginalFilename + evt.Process.MainModule.FileVersionInfo.FileName; bool keymapFound = false; List<ApplicationSearchSetting> applicationConfigurations = KeymapDatabase.Current.getKeymapSettings().getApplicationSearchSettings(); foreach (ApplicationSearchSetting searchSetting in applicationConfigurations) { string search = searchSetting.Search; if (appStringToMatch.ToLower().Replace(" ", "").Contains(search.ToLower().Replace(" ", ""))) { this.loadKeyMap(searchSetting.Keymap); keymapFound = true; } } if (!keymapFound) { this.setKeymap(this.fallbackKeymap); } } catch (Exception e) { Console.WriteLine("Could not change keymap config for " + evt.Process); } }