private void PollFireButton() { this.shootTimer.Interval = this._shotInterval; Keys fireKey = Keys.MButton; //default is middle mouse button fireKey = HelperFunctions.GetFireKeyFromString(this._fireButton); short gaks = GetAsyncKeyState(fireKey); if ((gaks & 0b10000000_00000000) > 0) //if the key is set (non-zero) i.e. the key is being held down { MouseHelperClass.LeftClickDown(); MouseHelperClass.LeftClickUp(); this.firingState = true; }
private void PollMouseButton(int dx, int dy, uint sleep, Keys key) { short gaks = GetAsyncKeyState(key); if ((gaks & 0b10000000_00000000) > 0) //if the key is set (non-zero) i.e. the key is being held down { MouseHelperClass.LeftClickDown(); MouseHelperClass.LeftClickUp(); if (this.PerformRecoilCompensation) { MouseHelperClass.MouseMove(dx, dy, sleep); } } }
private void PollMButton(int dx, int dy, uint sleep) { short gaks = GetAsyncKeyState(System.Windows.Forms.Keys.MButton); if ((gaks & 0b10000000_00000000) > 0) //if MSB is set (non-zero) i.e. middle button is being held down { MouseHelperClass.LeftClickDown(); MouseHelperClass.LeftClickUp(); if (this.PerformRecoilCompensation) { MouseHelperClass.MouseMove(dx, dy, sleep); } } }