diff --git a/YMouseButtonControl.Core/ViewModels/LayerViewModel/MouseComboViewModel.cs b/YMouseButtonControl.Core/ViewModels/LayerViewModel/MouseComboViewModel.cs index aa3f359..58d9daf 100644 --- a/YMouseButtonControl.Core/ViewModels/LayerViewModel/MouseComboViewModel.cs +++ b/YMouseButtonControl.Core/ViewModels/LayerViewModel/MouseComboViewModel.cs @@ -80,34 +80,12 @@ IShowSimulatedKeystrokesDialogService showSimulatedKeystrokesDialogService switch (next.Direction) { case WheelScrollDirection.VerticalUp when mouseButton == MouseButton.Mwu: - BackgroundColor = themeService.CurHighlight; - if (!_wheelTimer.Enabled) - { - _wheelTimer.Start(); - } - break; case WheelScrollDirection.VerticalDown when mouseButton == MouseButton.Mwd: - BackgroundColor = themeService.CurHighlight; - if (!_wheelTimer.Enabled) - { - _wheelTimer.Start(); - } - break; case WheelScrollDirection.HorizontalRight when mouseButton == MouseButton.Mwr: - BackgroundColor = themeService.CurHighlight; - if (!_wheelTimer.Enabled) - { - _wheelTimer.Start(); - } - break; case WheelScrollDirection.HorizontalLeft when mouseButton == MouseButton.Mwl: - BackgroundColor = themeService.CurHighlight; - if (!_wheelTimer.Enabled) - { - _wheelTimer.Start(); - } + MouseWheelDoHighlight(); break; } }); @@ -115,6 +93,7 @@ IShowSimulatedKeystrokesDialogService showSimulatedKeystrokesDialogService default: throw new ArgumentOutOfRangeException(nameof(mouseButton), mouseButton, null); } + _profilesService = profilesService; SourceCache sourceButtonMappings = new(x => x.Index); var myOp = sourceButtonMappings.Connect().AutoRefresh().Bind(out _btnMappings).Subscribe(); @@ -166,6 +145,16 @@ await ShowSimulatedKeystrokesDialogService.ShowSimulatedKeystrokesDialog( }, canClickUserClickedSettingsBtn ); + return; + + void MouseWheelDoHighlight() + { + BackgroundColor = themeService.CurHighlight; + if (!_wheelTimer.Enabled) + { + _wheelTimer.Start(); + } + } } public IBrush BackgroundColor @@ -173,6 +162,7 @@ public IBrush BackgroundColor get => _backgroundColor; set => this.RaiseAndSetIfChanged(ref _backgroundColor, value); } + public IShowSimulatedKeystrokesDialogService ShowSimulatedKeystrokesDialogService { get; } public BaseButtonMappingVm? SelectedBtnMap