コード例 #1
0
 public MatchQuality Matches(CustomInputShortcut customInputShortcut)
 {
     if (customInputShortcut.CustomData == CustomData)
     {
         return(MatchQuality.FullMatch);
     }
     else
     {
         return(MatchQuality.NoMatch);
     }
 }
コード例 #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);
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        protected virtual void OnCustomInputChanged(CustomInputShortcut shortcut)
        {
            CustomInputChangedEventHandler handler = CustomInputChanged;

            if (handler == null)
            {
                return;
            }

            CustomInputChangedEventArgs args = new CustomInputChangedEventArgs();

            args.SetValues(shortcut);
            handler(this, args);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 private void RefreshCommands()
 {
     if (!CompareCommands())
     {
         try
         {
             ClearCommands();
             FillCommandsRecursive(_List.Nodes);
         }
         finally
         {
             _CustomInputBindingsActiveNumber = -1;
             _OldCustomInputShortcut          = _CustomInputShortcut;
         }
     }
 }
コード例 #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;
        }
コード例 #9
0
        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();
            }
        }
コード例 #10
0
 private void edCustomInput_CustomInputChanged(object sender, CR_XkeysEngine.CustomInputChangedEventArgs ea)
 {
     _CustomInputShortcut = ea.Shortcut;
 }
コード例 #11
0
 public CustomInputChangedEventArgs()
 {
     _Shortcut = null;
 }
コード例 #12
0
 protected internal void SetValues(CustomInputShortcut shortcut)
 {
     _Shortcut = shortcut;
 }