private void AssignKeyBinding(string name, bool isTop) { Shortcut cut; if (isTop) { cut = data.GetTopShortcut(name); } else { cut = data.GetSideShortcut(name); } var result = new KeyBindingWindow(cut, name, isTop); if (result.ShowDialog() == true) { if (result.KeyBinding != null) { if (isTop) { data.SetTopShortcut(name, result.KeyBinding); } else { data.SetSideShortcut(name, result.KeyBinding); } data.Save(); } } RefreshPad(); flagBoundButtons(); }
private void AssignKeyBinding(int x, int y) { var cut = data.GetShortcut(y, x); var result = new KeyBindingWindow(cut, x, y); if (result.ShowDialog() == true) { data.SetShortcut(y, x, result.KeyBinding); int group = result.KeyBinding.belongsToGroup; if (group > 0) { data.addToGroup(group, y.ToString() + x); } data.Save(); } RefreshPad(); flagBoundButtons(); }