public string DoPassSignal() { CleanupKeyTap(); if (RewardKey != null && Globals.GameWindow != null) { if (KeyInteractType == KeyInteractType.TapKey && NextValidTapKeyTime <= DateTime.Now) { TapKeyCount++; Globals.GameWindow.KeyDown(RewardKey); KeyTapIsDown = true; KeyTapKeyUpTime = DateTime.Now.AddMilliseconds(50); NextValidTapKeyTime = DateTime.Now.AddMilliseconds(Globals.RepeatRate); if (NextValidTapKeyTime < KeyTapKeyUpTime) { NextValidTapKeyTime = KeyTapKeyUpTime.AddMilliseconds(10); } return("Tap: " + TapKeyCount.ToString()); } else if (KeyInteractType == KeyInteractType.HoldKey && PreviousKeyState == PassKeyState.KeyUp) { HoldKeyCount++; PreviousKeyState = PassKeyState.KeyDown; Globals.GameWindow.KeyDown(RewardKey); return("Hold: " + HoldKeyCount.ToString()); } } return(""); }
public RewardKeySender(TextBox keyDisplay, Label keyStateLog, KeyInteractType keyInteractType) { KeyDisplay = keyDisplay; KeyInteractType = keyInteractType; PreviousKeyState = PassKeyState.KeyUp; NextValidTapKeyTime = DateTime.Now; }
public void DoFailSignal() { CleanupKeyTap(); if (RewardKey != null && Globals.GameWindow != null) { if (KeyInteractType == KeyInteractType.HoldKey && PreviousKeyState == PassKeyState.KeyDown) { Globals.GameWindow.KeyUp(RewardKey); PreviousKeyState = PassKeyState.KeyUp; } } }