// Token: 0x06000073 RID: 115 RVA: 0x0000AC84 File Offset: 0x00008E84 private void btnAdd_Click(object sender, EventArgs e) { int selectedIndex = this.cbActions.SelectedIndex; if (selectedIndex > -1 && this.cbKeys.SelectedIndex > -1) { Keys keys = (Keys)Enum.Parse(typeof(Keys), this.cbKeys.SelectedItem.ToString()); if (!KeyboardHook.Instance.TargetedKeys.Contains(keys)) { Hotkey hotkey = new Hotkey { ActionIndex = selectedIndex, Key = keys, Text = string.Format("{0}: {1}", keys, this.cbActions.Items[selectedIndex]) }; hotkey.Install(); Hotkeys.InstalledHotkeys.Add(hotkey); this.lstKeys.Items.Add(hotkey); } } }
private void btnAdd_Click(object sender, EventArgs e) { int action = cbActions.SelectedIndex; if (action > -1 && cbKeys.SelectedIndex > -1) { Keys key = (Keys)Enum.Parse(typeof(Keys), cbKeys.SelectedItem.ToString()); if (!KeyboardHook.Instance.TargetedKeys.Contains(key)) { Hotkey h = new Hotkey { ActionIndex = action, Key = key, Text = $"{key}: {cbActions.Items[action]}" }; h.Install(); InstalledHotkeys.Add(h); lstKeys.Items.Add(h); } } }