Example #1
0
        private void keyboardHook_KeyUp(object sender, KeyEventArgs e)
        {
            var keyEventArgs = new SerializableKeyEventArgs()
            {
                KeyCode = e.KeyCode
            };

            events.Add(new MacroEvent(MacroEventType.KeyUp, keyEventArgs, Environment.TickCount - lastTimeRecorded));
            lastTimeRecorded = Environment.TickCount;
        }
Example #2
0
        public MacroEvent(MacroEventType macroEventType, SerializableKeyEventArgs eventArgs, int timeSinceLastEvent)
        {
            MacroEventType     = macroEventType;
            KeyEventArgs       = eventArgs;
            TimeSinceLastEvent = timeSinceLastEvent;

            EventId = UtcNowTicks.ToString();

            CurrentProcessName = ProcessHelper.GetForegroundProcessName();
            WindowSize         = ProcessHelper.GetWindowRect();
        }
Example #3
0
        private void keyboardHook_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Escape)
            {
                return;
            }
            var keyEventArgs = new SerializableKeyEventArgs()
            {
                KeyCode = e.KeyCode
            };

            events.Add(new MacroEvent(MacroEventType.KeyDown, keyEventArgs, Environment.TickCount - lastTimeRecorded));
            lastTimeRecorded = Environment.TickCount;
        }