private void selectedKeybinding_SelectedIndexChanged(object sender, EventArgs e) { current = bindings.bindings[selectedKeybinding.SelectedItem.ToString()]; Keybindings.Set(bindings); modifierShift.Checked = current.SHIFT; modifierCtrl.Checked = current.CTRL; modifierAlt.Checked = current.ALT; modifierSuper.Checked = current.SUPER; key.Text = current.Key.ToString(); }
public AdjustKeybindings(ref Keybindings keybindings) { InitializeComponent(); this.bindings = keybindings; foreach (string binding in keybindings.bindings.Keys) { selectedKeybinding.Items.Add(binding); } selectedKeybinding.SelectedIndex = 0; FormClosed += (a, b) => { Keybindings.Set(bindings); }; }