private void CurrentTimer_Tick(object sender, EventArgs e) { _timerTicks += 1; _currentTimer = TimeSpan.FromSeconds(_timerTicks); if (_timerTicks % 60 == 0) { KeysPressedChart.ChartAreas[0].AxisX.Maximum = _timerTicks / 60; KeysPressedChart.Series["Keys"].Points.AddXY(_timerTicks / 60, _document.KeysCounter); _document.KeysCounter = 0; _document.ProcessExists(); } if (_timeLimitIsActive == true) { TimeLabel.Text = _currentTimer.ToString() + " / " + _timeLeft.ToString(); if (_currentTimer >= _timeLeft) { StopButton.PerformClick(); } } else { TimeLabel.Text = _currentTimer.ToString(); } _document.UserIsActive(); }
/// <summary> /// This method handles the key bind presses /// NOTE: This might trigger anti-virus software /// as this is a popular method used in keyloggers /// </summary> private void GKS_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == startKey) { PlayButton.PerformClick(); } else if (e.KeyCode == stopKey) { StopButton.PerformClick(); } e.Handled = true; }
protected override void WndProc(ref Message m) { //Check for key down press if (m.Msg == WM_HOTKEY) { //Switch over the ID assigned switch (m.WParam.ToInt32()) { case F6HOTKEYID: if (ClickerEnabled == true) { StopButton.PerformClick(); } else if (ClickerEnabled == false) { StartButton.PerformClick(); } break; case F7HOTKEYID: if (ClickerEnabled == false && SetPosRadio.Checked) { this.Cursor = new Cursor(Cursor.Current.Handle); this.CursorPoint = new Point(Cursor.Position.X, Cursor.Position.Y); this.XPosition = Cursor.Position.X; this.YPosition = Cursor.Position.Y; this.XPos.Text = Cursor.Position.X.ToString(); this.YPos.Text = Cursor.Position.Y.ToString(); } break; } } base.WndProc(ref m); }