public void LoadGamepadControls(CommandGamepadCodeDict controls) { var inputs = ConvertToGamepadInputs(controls); gamepadButtonInputs = inputs.gamepadButtonInputs; gamepadAxisInputs = inputs.gamepadAxisInputs; }
Dictionary <string, GamepadCommand> gamepadAxisInputs) // Return a tuple ConvertToGamepadInputs(CommandGamepadCodeDict lGamepadControls) { Dictionary <string, GamepadCommand> lGamepadButtonInputs = new Dictionary <string, GamepadCommand>(); Dictionary <string, GamepadCommand> lGamepadAxisInputs = new Dictionary <string, GamepadCommand>(); foreach (KeyValuePair <GamepadCommand, GamepadCode> kvp in lGamepadControls) { // Button if (kvp.Value < GamepadCode.LeftHorizontal) { lGamepadButtonInputs.Add(kvp.Value.ToString("g"), kvp.Key); } // Axis else { lGamepadAxisInputs.Add(kvp.Value.ToString("g"), kvp.Key); } } return(lGamepadButtonInputs, lGamepadAxisInputs); }