private void edConsoleKey_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { using (var dlg = new KeyBindForm("Please press your TOXIKK console key ...")) { if (dlg.ShowDialog(this) == DialogResult.OK) { this.ConsoleKey = dlg.Key; } } }
private void KeyBindButton_Click(object sender, EventArgs e) { KeyBindForm f = new KeyBindForm(); f.SelectedKey = selKeyBindingVal; if (f.ShowDialog() == DialogResult.OK) { var val = f.SelectedKey; selKeyBindingVal = val; KeyBindingComboBox.SelectedItem = val; keyBindings.SetBinding(selKeyBinding, val); UpdateKeyBindingsListViewItem(selKeyBinding, val); Settings.Default.KeyBindings = keyBindings.GetSetting(); if (worldForm != null) { worldForm.SetKeyBindings(keyBindings); } } }