private void button1_Click(object sender, EventArgs e) { if (textBox3.Text != string.Empty) { if (keyassignation != null) { bool accep = true; for (int i = 0; i < nombreditems; i++) { HKMDB Truc = (HKMDB)listOfHotkeys[i]; if (Truc.KeyToString() == HKMDB.KeyToString(keyassignation) && i != listBox1.SelectedIndex) { accep = false; MessageBox.Show("Already Choosen!", "Error"); } } if (accep == true) { listOfHotkeys[listBox1.SelectedIndex] = new HKMDB(keyassignation, listBox1.SelectedIndex); } } else { MessageBox.Show("Erreur", "Erreur Impossible"); } } refresh(); }
private void refresh() { keyassignation = null; HKMDB Truc = (HKMDB)listOfHotkeys[listBox1.SelectedIndex]; textBox1.Text = Truc.KeyToString(); textBox3.Text = string.Empty; }
private void analyzehwnd() { analyzencour = 0; analyzfini = false; hwnd = new IntPtr[botnumber]; pid = new IntPtr[botnumber]; //HotKeyModifier HKM = HKMDB ConsoleHK = SomeSettings.UserHotkey[0] as HKMDB; sendtext("->Entering windows handle configuration", ConsoleLvl.Medium); sendtext("Click on the WoW window of the character asked then press " + ConsoleHK.KeyToString()); // sendtext(ConsoleHK.MainKey().ToString() + "-" + ConsoleHK.Modifiers().ToString()); SomeSettings.hkm.Register(ConsoleHK.MainKey(), (HotKeyModifier)ConsoleHK.Modifiers(), 1, new HotKeyEventHandler(analyzethwnd)); sendtext("Main character: " + botHub.getClasse(analyzencour) + "..."); }
private void textBox3_KeyDown(object sender, KeyEventArgs e) { textBox3.Text = HKMDB.KeyToString(e); keyassignation = e; }