private void ConfigForm_FormClosing(object sender, FormClosingEventArgs e) { foreach (var hotKeyControl in keyBindings) { ; ((GlobalHotKey)keyList[Array.IndexOf(keyBindings, hotKeyControl)]).Enabled = (hotKeyControl.Text != string.Empty); } KeyBinding.SaveConfig(); hkm.RemoveHotKey("Start"); hkm.RemoveHotKey("Stop"); hkm.RemoveHotKey("Pause"); hkm.RemoveHotKey("PitchUp"); hkm.RemoveHotKey("PitchDown"); foreach (GlobalHotKey k in keyList) { if (k.Enabled) { hkm.AddGlobalHotKey(k); } } hkm.Enabled = true; }
private void HotKeyControl1_HotKeyIsReset(object sender, EventArgs e) { var s = sender as HotKeyControl; var index = Array.IndexOf(keyBindings, s); ((GlobalHotKey)keyList[index]).Enabled = false; KeyBinding.SaveConfig(); }
private void HotKeyControl1_HotKeyIsSet(object sender, HotKeyIsSetEventArgs e) { var s = sender as HotKeyControl; var index = Array.IndexOf(keyBindings, s); ((GlobalHotKey)keyList[index]).Enabled = false; ((GlobalHotKey)keyList[index]).Key = s.UserKey; ((GlobalHotKey)keyList[index]).Modifier = s.UserModifier; ((GlobalHotKey)keyList[index]).Enabled = true; KeyBinding.SaveConfig(); }
private void btnApply_Click(object sender, EventArgs e) { KeyBinding.SaveConfig(); Close(); }