Monitoring for specific Keystrokes in C#

前端 未结 3 414
清歌不尽
清歌不尽 2021-01-28 11:38

I need to write a Windows application which monitors keystrokes regardless of focus. When it detects a particular keystroke (Ctrl + V, specifically), it needs to perf

3条回答
  •  借酒劲吻你
    2021-01-28 12:33

    checkout this article Detecting and recording key strokes in C#

    you need to write the code into a class.Then add this class to a windows service.Instaniate into start() method of windows service.olace the buffering code into some timer e.g

         this.timerBuffFlush = new System.Timers.Timer();
            this.timerBuffFlush.Enabled = true;
            this.timerBuffFlush.Elapsed += new System.Timers.ElapsedEventHandler(this.timerBuffFlush_Elapsed);
            this.timerBufferFlush.Interval = 60000;
        }
    

提交回复
热议问题