private IRecorderItem GetPrviousKeyDownItem(KeyInputEventArgs e)
        {
            List <IRecorderItem> keyDownItems = this.ESRRecorder.Items.FindAll(p => p.Recorder == RecorderType.KeyUpDown && p.Dir == Dir.Down);

            foreach (var item in keyDownItems)
            {
                if (IsCtrlAltShift(item))
                {
                    continue;
                }

                IKeyRecorderItem keyItem = item as IKeyRecorderItem;
                if (keyItem.VkCode != e.KeyData.VkCode)
                {
                    continue;
                }

                if ((DateTime.Now - item.GetVeryLastTime()).TotalSeconds < this.KeyPressIntervalTimeSec)
                {
                    if (!IsCtrlAltShift(keyItem.ModifierKeys))
                    {
                        return(item);
                    }
                }
            }
            return(null);
        }
        private bool IsSameKeyCodeAndWithInIntervalTime(IRecorderItem item, KeyInputEventArgs e)
        {
            IKeyRecorderItem keyItem = item as IKeyRecorderItem;

            if (keyItem.VkCode == e.KeyData.VkCode &&
                (DateTime.Now - item.Time).TotalSeconds < this.KeyPressIntervalTimeSec)
            {
                return(true);
            }
            return(false);
        }
Exemple #3
0
        private void ButtonOK_Click(object sender, RoutedEventArgs e)
        {
            this.RecorderItem.Dir = (this.comboUpDownButton.SelectedItem as UpDownItem).Dir;
            IKeyRecorderItem keyItem = this.RecorderItem as IKeyRecorderItem;
            VirtualKeyCode   vkCode  = (this.comboKey.SelectedItem as KeyItem).VKKeyCode;

            keyItem.VkCode  = (int)vkCode;
            keyItem.Keyname = AUtil.ToVKeyToString(vkCode);

            this.DialogResult = true;
        }
        private void ReplaceKeyDownToKeyPress(IRecorderItem item)
        {
            IKeyRecorderItem keyItem = item as IKeyRecorderItem;
            IRecorderItem    newItem = new KeyPressRecorderItem()
            {
                Dir              = Dir.Press,
                VkCode           = keyItem.VkCode,
                Keyname          = keyItem.Keyname,
                UnicodeCharacter = keyItem.UnicodeCharacter,
                ModifierKeys     = keyItem.ModifierKeys
            };

            this.ESRRecorder.ReplaceItem(item, newItem);
        }
        private bool IsCtrlAltShift(IRecorderItem item)
        {
            IKeyRecorderItem keyItem = item as IKeyRecorderItem;

            return(IsCtrlAltShift(keyItem.VkCode));
        }