Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
 private void btnApply_Click(object sender, EventArgs e)
 {
     KeyBinding.SaveConfig();
     Close();
 }