private IEnumerable<IInputInput> _GetInputs(SlimDX.DirectInput.Joystick device) { foreach (DeviceObjectInstance deviceObjectInstance in device.GetObjects()) { JoystickInput input = null; if (_IsButton(deviceObjectInstance)) { input = new Button(deviceObjectInstance.Name, deviceObjectInstance.Usage); } else if (_IsAxis(deviceObjectInstance)) { input = _IsRotationAxis(deviceObjectInstance) ? _CreateRotationAxis(deviceObjectInstance) : _CreateAxis(deviceObjectInstance); } else if (_IsPov(deviceObjectInstance)) { input = new Pov(deviceObjectInstance.Name, deviceObjectInstance.DesignatorIndex); } if (input != null) { yield return input; } } }