示例#1
0
        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("");
        }
示例#2
0
 public RewardKeySender(TextBox keyDisplay, Label keyStateLog, KeyInteractType keyInteractType)
 {
     KeyDisplay          = keyDisplay;
     KeyInteractType     = keyInteractType;
     PreviousKeyState    = PassKeyState.KeyUp;
     NextValidTapKeyTime = DateTime.Now;
 }
示例#3
0
        public void DoFailSignal()
        {
            CleanupKeyTap();

            if (RewardKey != null && Globals.GameWindow != null)
            {
                if (KeyInteractType == KeyInteractType.HoldKey && PreviousKeyState == PassKeyState.KeyDown)
                {
                    Globals.GameWindow.KeyUp(RewardKey);
                    PreviousKeyState = PassKeyState.KeyUp;
                }
            }
        }