private static IControllerElementMappings GetDefaultDeviceMappings(IControllerLayout realDevice, IControllerLayout virtualDevice) { var mappedElements = from element in virtualDevice.Layout select new MappedControllerElement(element.Key, realDevice.Layout[element.Key] != null ? element.Key : ControllerElement.NoElement); var elementCollection = new ControllerElementMappings(realDevice.LayoutId, virtualDevice.LayoutId); foreach (var element in mappedElements) { elementCollection.Add(element); } return(elementCollection); }
private static IControllerElementMappings GetDefaultKeyboardMappings(IControllerLayout realKeyboard, IControllerLayout virtualDevice) { var mappedElements = from element in virtualDevice.Layout select new MappedControllerElement(element.Key, ControllerElementMappings.DefaultKeyboardMappings.ContainsKey(element.Key) ? ControllerElementMappings.DefaultKeyboardMappings[element.Key] : ControllerElement.KeyNone); var elementCollection = new ControllerElementMappings(realKeyboard.LayoutId, virtualDevice.LayoutId); foreach (var element in mappedElements) { elementCollection.Add(element); } return(elementCollection); }