Beispiel #1
0
        private void HookKeyboardEngine_KeyDown(object sender, KeyEventArgs e)
        {
            KeyEntity k = new KeyEntity();

            k.Key  = e.KeyCode;
            k.Time = DateTime.Now;
            _current.AddDown(k);
        }
Beispiel #2
0
        private void HookKeyboardEngine_KeyUp(object sender, KeyEventArgs e)
        {
            KeyEntity k = new KeyEntity();

            k.Key  = e.KeyCode;
            k.Time = DateTime.Now;
            _current.RemoveDown(k);
            _current.Add(k);

            foreach (var item in _collection)
            {
                // Todo :匹配规则触发任务
                if (_current.Equals(item.Item1))
                {
                    item.Item2.Invoke(item.Item1);
                }
            }
        }