private void button_set_Click(object sender, EventArgs e) { // int nModKey = 0; // if (sarrayMods.Length > 0) // { // for (int i = 0; i < sarrayMods.Length; i++) // { // switch (sarrayMods[i]) // { // case "Alt": // nModKey = nModKey |(int) HotKey.MOD.MOD_ALT; // break; // case "Ctrl": // nModKey = nModKey | (int)HotKey.MOD.MOD_CTRL; // break; // case "Shift": // nModKey = nModKey | (int)HotKey.MOD.MOD_SHIFT; // break; // } // } // } // // if (HotKey.RegHotKey(this.Handle, nHotKeyStartID, nModKey, key)) // MessageBox.Show("热键设置成功!"); // else // MessageBox.Show("热键设置失败!"); ShootLoop.startRunSpeedAutoKey(); }
/// <summary> /// 热键调用的方法 /// </summary> private void Method() { nTimes++; Random random = new Random(); int nRoll = random.Next(1, 100); string sText = "第 " + nTimes.ToString() + " 次按下热键,本次得到点数:[ " + nRoll.ToString() + " ]"; this.label_text.Text = sText; ShootLoop.startRunAutoKey(); }