private void _MoveMouse() { int i = 0; while (appRunning) { if (MagicMouse.bGetAsyncKeyState(Keys.LButton) && _ENABLED && tbIncrease.Value != 0) { MagicMouse.Move(0, tbStep.Value + (tbIncrease.Value * i)); Thread.Sleep(tbDelay.Value); if ((tbStep.Value + (tbIncrease.Value * i)) < tbMax.Value) { i++; } } else if (MagicMouse.bGetAsyncKeyState(Keys.LButton) && _ENABLED) { MagicMouse.Move(0, tbStep.Value); Thread.Sleep(tbDelay.Value); } else { i = 0; } } }
private void cbChroma_CheckedChanged(object sender, EventArgs e) { if (cbChroma.Checked) { MagicMouse.InitializeChroma(); } }
private void btnLoad_Click(object sender, EventArgs e) { int[] settings = MagicMouse.LoadIntConfig(_configLoc + "\\" + cbConfigs.Text); tbStep.Value = settings[0]; tbDelay.Value = settings[1]; tbIncrease.Value = settings[2]; tbMax.Value = settings[3]; }
private void btnSave_Click(object sender, EventArgs e) { int[] settings = { tbStep.Value, tbDelay.Value, tbIncrease.Value, tbMax.Value, }; MagicMouse.SaveIntConfig(_configLoc + "\\" + cbConfigs.Text, settings); }
private void _Update() { while (appRunning) { lblStep.Text = "Step[" + tbStep.Value.ToString() + "]:"; lblDelay.Text = "Delay[" + tbDelay.Value.ToString() + "]:"; lblIncrease.Text = "Increase[" + tbIncrease.Value.ToString() + "]:"; lblMax.Text = "Max Inc.[" + tbMax.Value.ToString() + "]:"; bool buffer = true; while (MagicMouse.bGetAsyncKeyState(Keys.F2)) { if (buffer) { _ENABLED = !_ENABLED; buffer = false; } } if (_ENABLED) { if (MagicMouse._CHROMA_INITIALIZED && cbChroma.Checked) { MagicMouse.StateEnabled(); } lblState.Text = "ENABLED [F2]"; lblState.ForeColor = Color.Green; tbStep.Enabled = false; tbDelay.Enabled = false; tbIncrease.Enabled = false; tbMax.Enabled = false; } else { if (MagicMouse._CHROMA_INITIALIZED && cbChroma.Checked) { MagicMouse.StateDisabled(); } lblState.Text = "DISABLED [F2]"; lblState.ForeColor = Color.Red; tbStep.Enabled = true; tbDelay.Enabled = true; tbIncrease.Enabled = true; tbMax.Enabled = true; } Thread.Sleep(1); buffer = true; } }