Exemplo n.º 1
0
 void hotKeyControl1_HotKeyIsSet(object sender, HotKeyIsSetEventArgs e)
 {
     if (MainForm.MyHotKeyManager.HotKeyExists(e.Shortcut, HotKeyManager.CheckKey.LocalHotKey))
     {
         e.Cancel = true;
         MessageBox.Show("This HotKey has already been registered");
     }
 }
Exemplo n.º 2
0
 private void HotKeyIsSet(object sender, HotKeyIsSetEventArgs e)
 {
     if (hotKeyManager.HotKeyExists(e.Shortcut, HotKeyManager.CheckKey.LocalHotKey) || CheckHotKeyExist())
     {
         e.Cancel = true;
         MaterialSkin.MsgBox.Show(Properties.Resources.StrShortcutExist, Properties.Resources.StrWaring, MaterialSkin.MsgBox.Buttons.OK, MaterialSkin.MsgBox.Icon.Warning);
     }
 }
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 hotKeyControl_HotKeyIsSet(object sender, HotKeyIsSetEventArgs e)
        {
            var tuple    = (Tuple <DataFlow, HotKey>)hotKeyControl.Tag;
            var newTuple = new Tuple <DataFlow, HotKey>(tuple.Item1, e.HotKey);

            hotKeyControl.Tag = newTuple;

            if (AppModel.Instance.SetHotkeyCombination(newTuple.Item2, newTuple.Item1))
            {
                return;
            }

            e.Cancel       = true;
            e.CancelReason = SettingsStrings.hotkeys;
        }
Exemplo n.º 5
0
 private void TextBox_KeyUp(object sender, KeyEventArgs e)
 {
     if (!this.KeyisSet)
     {
         this.Text = string.Empty;
     }
     else if (this.HotKeyIsSet != null)
     {
         HotKeyIsSetEventArgs e1 = new HotKeyIsSetEventArgs(this.UserKey, this.UserModifier);
         this.HotKeyIsSet((object)this, e1);
         if (e1.Cancel)
         {
             this.KeyisSet = false;
             this.Text     = string.Empty;
         }
     }
 }
Exemplo n.º 6
0
 private void TextBox_KeyUp(object sender, KeyEventArgs e)
 {
     //On KeyUp if KeyisSet is False then clear the textbox.
     if (KeyisSet == false)
     {
         this.Text = String.Empty;
     }
     else
     {
         if (HotKeyIsSet != null)
         {
             var ex = new HotKeyIsSetEventArgs(UserKey, UserModifier);
             HotKeyIsSet(this, ex);
             if (ex.Cancel)
             {
                 KeyisSet  = false;
                 this.Text = String.Empty;
             }
         }
     }
 }