public void UpdateControllerMappings(Dictionary <ControllerButtons, int> mappings) { var newMapping = new InteropEmu.KeyMappingSet(); newMapping.Mapping1.A = GetMapping(mappings, ControllerButtons.A); newMapping.Mapping1.B = GetMapping(mappings, ControllerButtons.B); newMapping.Mapping1.Down = GetMapping(mappings, ControllerButtons.Down); newMapping.Mapping1.Up = GetMapping(mappings, ControllerButtons.Up); newMapping.Mapping1.Left = GetMapping(mappings, ControllerButtons.Left); newMapping.Mapping1.Right = GetMapping(mappings, ControllerButtons.Right); newMapping.Mapping1.Select = GetMapping(mappings, ControllerButtons.Select); newMapping.Mapping1.Start = GetMapping(mappings, ControllerButtons.Start); InteropEmu.SetControllerKeys(0, newMapping); }
public InteropEmu.KeyMappingSet GetKeyMappingSet() { while (Keys.Count < 4) { Keys.Add(new KeyMappings()); } InteropEmu.KeyMappingSet mappingSet = new InteropEmu.KeyMappingSet(); mappingSet.Mapping1 = Keys[0].ToInteropMapping(); mappingSet.Mapping2 = Keys[1].ToInteropMapping(); mappingSet.Mapping3 = Keys[2].ToInteropMapping(); mappingSet.Mapping4 = Keys[3].ToInteropMapping(); mappingSet.TurboSpeed = TurboSpeed; return(mappingSet); }