Exemplo n.º 1
0
 public MatchQuality Matches(CustomInputShortcut customInputShortcut)
 {
     if (customInputShortcut.CustomData == CustomData)
     {
         return(MatchQuality.FullMatch);
     }
     else
     {
         return(MatchQuality.NoMatch);
     }
 }
Exemplo n.º 2
0
        public CustomInputShortcut Clone()
        {
            CustomInputShortcut clone = new CustomInputShortcut();

            clone.AltKeyDown       = AltKeyDown;
            clone.ShiftKeyDown     = ShiftKeyDown;
            clone.CtrlKeyDown      = CtrlKeyDown;
            clone.AnyShiftModifier = AnyShiftModifier;
            clone.CustomData       = CustomData;
            return(clone);
        }
        public XkeysEditControl()
        {
            InitializeComponent();

            xkeysEngine              = new XkeysEngine();
            xkeysEngine.XkeyPressed += xkeysEngine_XkeyPressed;

            _Shortcut = new CustomInputShortcut();
            XkeysRaw.Data.DataChanged += Data_DataChanged;
            xkeysPainter.SetKeySizeToFit(xkeyPreview.ClientRectangle.Size);
            xkeyLayout = xkeysPainter.GetLayout(XkeysRaw.Data.LastKeyCode, XkeysRaw.Data.BlockedKeysMask);
            xkeyLayout.Load();
        }
        protected virtual void OnCustomInputChanged(CustomInputShortcut shortcut)
        {
            CustomInputChangedEventHandler handler = CustomInputChanged;

            if (handler == null)
            {
                return;
            }

            CustomInputChangedEventArgs args = new CustomInputChangedEventArgs();

            args.SetValues(shortcut);
            handler(this, args);
        }
        private void BindingDataChanged(object sender, System.EventArgs e)
        {
            if (_UpdatingInternally)
            {
                return;
            }
            if (sender == btnAlt || sender == btnCtrl || sender == btnShift)
            {
                chkAny.Checked = false;
            }
            CustomInputShortcut shortcut = ShortcutFromControls();

            OnCustomInputChanged(shortcut);
        }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_Shortcut != null)
         {
             _Shortcut = null;
         }
         if (components != null)
         {
             components.Dispose();
         }
     }
     base.Dispose(disposing);
 }
Exemplo n.º 7
0
 private void RefreshCommands()
 {
     if (!CompareCommands())
     {
         try
         {
             ClearCommands();
             FillCommandsRecursive(_List.Nodes);
         }
         finally
         {
             _CustomInputBindingsActiveNumber = -1;
             _OldCustomInputShortcut          = _CustomInputShortcut;
         }
     }
 }
Exemplo n.º 8
0
        // private methods ..
        private void CleanUpVariables()
        {
            _List = null;

            _OldFolderName          = "";
            _OldCustomInputShortcut = null;
            _OldCommandName         = "";

            _CustomInputShortcut = null;

            _FoldersActiveNumber             = -1;
            _CustomInputBindingsActiveNumber = -1;
            _CommandActiveNumber             = -1;

            _Folders             = null;
            _CustomInputBindings = null;
            _CommandBindings     = null;
        }
        public void UpdateShortcut()
        {
            if (CustomDataIsInvalid())
            {
                _Shortcut = null;
            }
            else
            {
                if (_Shortcut == null)
                {
                    _Shortcut = new CustomInputShortcut();
                }

                _Shortcut.CtrlKeyDown      = btnCtrl.Checked;
                _Shortcut.AnyShiftModifier = chkAny.Checked;
                _Shortcut.AltKeyDown       = btnAlt.Checked;
                _Shortcut.ShiftKeyDown     = btnShift.Checked;
                _Shortcut.CustomData       = GetCustomData();
            }
        }
Exemplo n.º 10
0
 private void edCustomInput_CustomInputChanged(object sender, CR_XkeysEngine.CustomInputChangedEventArgs ea)
 {
     _CustomInputShortcut = ea.Shortcut;
 }
Exemplo n.º 11
0
 public CustomInputChangedEventArgs()
 {
     _Shortcut = null;
 }
Exemplo n.º 12
0
 protected internal void SetValues(CustomInputShortcut shortcut)
 {
     _Shortcut = shortcut;
 }