/// <summary> /// Processes the current keystate to set a keybinding. /// </summary> /// <param name="currentState"></param> internal void ProcessKey(Microsoft.Xna.Framework.Input.KeyboardState currentState) { foreach (TabPage tp in tcControlGroups.Controls) { // if the tab page is one of the custom tab pages (should always be the case) if (tp is FlowLayoutTabPage) { // make it so FlowLayoutTabPage fltp = tp as FlowLayoutTabPage; // in case this tab page contains the active keybinding control needing to set its binding. fltp.ProcessKey(currentState); } } }
/// <summary> /// Adds controls (custom tab pages containing keybindingControls) for displaying each keybinding /// </summary> public void AddKeyBindingGuiControls() { for (int kmi = 0; kmi < keyMaps.inputMaps.Count; kmi++) { FlowLayoutTabPage fltp = new FlowLayoutTabPage(); tcControlGroups.TabPages.Add(fltp); InputMap im = keyMaps.inputMaps.Values[kmi]; if (im is ButtonMap == false) { continue; } ButtonMap bm = im as ButtonMap; fltp.Text = bm.Alias; foreach (Input.KeyBinding kb in bm.ButtonBindings.Values) { KeyBindingControl kbc = new KeyBindingControl(kb); fltp.AddControl(kbc); } } }