private void toggleButton_Click(object sender, EventArgs e) { if (boundListBox.SelectedItem == null) { } else { eventHookForm bindForm = new eventHookForm(); DialogResult result = bindForm.ShowDialog(); if (result == DialogResult.OK) { if (bindForm.inputType == InputType.KEYBOARD) { //create a toggle for the key chosen keyBinds.ElementAt(selectedMacro).key = bindForm.key.KeyCode; keyBinds.ElementAt(selectedMacro).startType = InputType.KEYBOARD; } if (bindForm.inputType == InputType.MOUSE) { keyBinds.ElementAt(selectedMacro).mouseKey = bindForm.mouse.Button; keyBinds.ElementAt(selectedMacro).startType = InputType.MOUSE; } keyBinds.ElementAt(selectedMacro).eventType = bindForm.keyEvent; bindForm.Close(); keyBinds.ElementAt(selectedMacro).toggleThis = true; } macroListBox.Focus(); refreshMacro(); } }
private void keyTextBox_Click(object sender, EventArgs e) { eventHookForm bindForm = new eventHookForm(); DialogResult result = bindForm.ShowDialog(); if (result == DialogResult.OK) { key = bindForm.key.KeyCode; eventType = bindForm.keyEvent; typeListBox.SelectedItem = eventType.ToString(); keyTextBox.Text = key.ToString(); } checkComplete(); }
private void button1_Click(object sender, EventArgs e) { eventHookForm aform = new eventHookForm(); DialogResult result = aform.ShowDialog(); if (result == DialogResult.OK) { if (aform.inputType == InputType.KEYBOARD) { keyBinds.ElementAt(selectedMacro).key = aform.key.KeyCode; keyBinds.ElementAt(selectedMacro).startType = InputType.KEYBOARD; } if (aform.inputType == InputType.MOUSE) { keyBinds.ElementAt(selectedMacro).mouseKey = aform.mouse.Button; keyBinds.ElementAt(selectedMacro).startType = InputType.MOUSE; } keyBinds.ElementAt(selectedMacro).eventType = aform.keyEvent; aform.Close(); refreshMacro(); } }
private void mimicButton_Click(object sender, EventArgs e) { eventHookForm form = new eventHookForm(); DialogResult result = form.ShowDialog(); if (result == DialogResult.OK) { if (form.inputType == InputType.KEYBOARD) { //create a macro for the key chosen keyBinds.ElementAt(selectedMacro).secondKey = form.key.KeyCode; keyBinds.ElementAt(selectedMacro).secondaryType = InputType.KEYBOARD; } if (form.inputType == InputType.MOUSE) { keyBinds.ElementAt(selectedMacro).secMouseKey = form.mouse.Button; keyBinds.ElementAt(selectedMacro).secondaryType = InputType.MOUSE; } form.Close(); } macroListBox.Focus(); refreshMacro(); }