private void RebuildMapForNewDevice(IHOTASDevice device, IHOTASDevice newDevice) { newDevice.ApplyButtonMap(device.ButtonMap.ToObservableCollection()); newDevice.SetModeProfile(device.ModeProfiles); newDevice.SetModeActivation(ModeProfileActivationButtons); Devices.Add(newDevice); }
public void ListenToDevice(IHOTASDevice device) { device.ButtonPressed += Device_ButtonPressed; device.AxisChanged += Device_AxisChanged; device.KeystrokeDownSent += Device_KeystrokeDownSent; device.KeystrokeUpSent += Device_KeystrokeUpSent; device.MacroStarted += Device_MacroStarted; device.MacroCancelled += Device_MacroCancelled; device.ModeProfileSelected += Device_ModeProfileSelected; device.ShiftReleased += Device_ShiftReleased; device.LostConnectionToDevice += Device_LostConnectionToDevice; device.SetModeActivation(ModeProfileActivationButtons); device.ListenAsync(); }