public JoystickInfo(string name, Joysticks joystick, JoystickButton[] buttons, JoystickAxis[] axes, IInputListener[] listeners) : base(name, listeners) { _joystick = joystick; _buttons = new List<JoystickButton>(buttons); _axes = new List<JoystickAxis>(axes); }
public void AddButton(JoystickButton button) { _buttons.Add(button); if (!NameButtonDict.ContainsKey(button.Name)) { NameButtonDict[button.Name] = new List<JoystickButton>(); } NameButtonDict[button.Name].Add(button); }
public void SetButtons(JoystickButton[] buttons) { _buttons = new List<JoystickButton>(buttons); BuildNameButtonDict(); }
public void RemoveButton(JoystickButton button) { _buttons.Remove(button); if (NameButtonDict.ContainsKey(button.Name)) { NameButtonDict[button.Name].Remove(button); } }
public void RemoveButtons(JoystickButton[] buttons) { foreach (JoystickButton button in buttons) { RemoveButton(button); } }
public void AddButtons(JoystickButton[] buttons) { foreach (JoystickButton button in buttons) { AddButton(button); } }