using System; using SlimDX.DirectInput; namespace BizHawk.MultiClient { public static class Input { public static void Initialize() { KeyInput.Initialize(); GamePad.Initialize(); } public static void Update() { KeyInput.Update(); GamePad.UpdateAll(); } public static bool IsPressed(string control) { string[] controls = control.Split('+'); for (int i=0; i= GamePad.Devices.Count) return false; if (control == "Up") return GamePad.Devices[index].Up; if (control == "Down") return GamePad.Devices[index].Down; if (control == "Left") return GamePad.Devices[index].Left; if (control == "Right") return GamePad.Devices[index].Right; if (control.StartsWith("B")) { int buttonIndex = int.Parse(control.Substring(1)) - 1; if (buttonIndex >= GamePad.Devices[index].Buttons.Length) return false; return GamePad.Devices[index].Buttons[buttonIndex]; } return false; } public static string GetPressedKey() { //for (int j = 0; j < GamePad.Devices.Count; j++) return null; } } }