From d6074cfdb1708a89c423cab0fa2dc4f20674a523 Mon Sep 17 00:00:00 2001 From: FaithBeam <32502411+FaithBeam@users.noreply.github.com> Date: Sat, 26 Oct 2024 08:13:47 -0400 Subject: [PATCH] Disable the block original mouse input checkbox on linux Add tooltip to Simulated Keystroke type to point out mode 6 doesn't work properly on linux --- .../SimulatedKeystrokesDialogViewModel.cs | 12 ++++++- .../ViewModels/Models/BaseButtonMappingVm.cs | 4 +-- .../Models/ButtonMapping.cs | 2 +- .../Dialogs/SimulatedKeystrokesDialog.axaml | 32 +++++++++++++++---- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/YMouseButtonControl.Core/ViewModels/LayerViewModel/SimulatedKeystrokesDialogViewModel.cs b/YMouseButtonControl.Core/ViewModels/LayerViewModel/SimulatedKeystrokesDialogViewModel.cs index 4f28a35..4f7ad72 100644 --- a/YMouseButtonControl.Core/ViewModels/LayerViewModel/SimulatedKeystrokesDialogViewModel.cs +++ b/YMouseButtonControl.Core/ViewModels/LayerViewModel/SimulatedKeystrokesDialogViewModel.cs @@ -29,7 +29,8 @@ public class SimulatedKeystrokesDialogViewModel : DialogBase, IDisposable private string _description; private readonly string _title; private int _caretIndex; - private bool _blockOriginalMouseInput = true; + private bool _blockOriginalMouseInput; + private bool _blockOriginalMouseInputEnabled; private short _x; private short _y; private int _autoRepeatDelay; @@ -58,6 +59,9 @@ public SimulatedKeystrokesDialogViewModel( _customKeys = currentMapping.Keys ?? string.Empty; _autoRepeatDelay = currentMapping.AutoRepeatDelay ?? 33; _autoRepeatRandomizeDelayChecked = currentMapping.AutoRepeatRandomizeDelayEnabled ?? false; + _blockOriginalMouseInput = + !OperatingSystem.IsLinux() && (currentMapping.BlockOriginalMouseInput ?? true); + _blockOriginalMouseInputEnabled = !OperatingSystem.IsLinux(); SimulatedKeystrokesType = currentMapping.SimulatedKeystrokeType ?? new MouseButtonPressedActionTypeVm(); _autoRepeatEnabled = @@ -167,6 +171,12 @@ public bool BlockOriginalMouseInput set => this.RaiseAndSetIfChanged(ref _blockOriginalMouseInput, value); } + public bool BlockOriginalMouseInputEnabled + { + get => _blockOriginalMouseInputEnabled; + set => this.RaiseAndSetIfChanged(ref _blockOriginalMouseInputEnabled, value); + } + public int AutoRepeatDelay { get => _autoRepeatDelay; diff --git a/YMouseButtonControl.Core/ViewModels/Models/BaseButtonMappingVm.cs b/YMouseButtonControl.Core/ViewModels/Models/BaseButtonMappingVm.cs index 2e3ad9b..f631ebe 100644 --- a/YMouseButtonControl.Core/ViewModels/Models/BaseButtonMappingVm.cs +++ b/YMouseButtonControl.Core/ViewModels/Models/BaseButtonMappingVm.cs @@ -16,7 +16,7 @@ public abstract class BaseButtonMappingVm : ReactiveObject, IEquatable _simulatedKeystrokeTypeVm; set => this.RaiseAndSetIfChanged(ref _simulatedKeystrokeTypeVm, value); } - public bool BlockOriginalMouseInput + public bool? BlockOriginalMouseInput { get => _blockOriginalMouseInput; set => this.RaiseAndSetIfChanged(ref _blockOriginalMouseInput, value); diff --git a/YMouseButtonControl.DataAccess/Models/ButtonMapping.cs b/YMouseButtonControl.DataAccess/Models/ButtonMapping.cs index 1ef73ad..16cefea 100644 --- a/YMouseButtonControl.DataAccess/Models/ButtonMapping.cs +++ b/YMouseButtonControl.DataAccess/Models/ButtonMapping.cs @@ -24,7 +24,7 @@ public abstract class ButtonMapping public int? AutoRepeatDelay { get; set; } public bool? AutoRepeatRandomizeDelayEnabled { get; set; } public bool Selected { get; set; } - public bool BlockOriginalMouseInput { get; set; } + public bool? BlockOriginalMouseInput { get; set; } public ButtonMappingType ButtonMappingType { get; set; } } diff --git a/YMouseButtonControl/Views/Dialogs/SimulatedKeystrokesDialog.axaml b/YMouseButtonControl/Views/Dialogs/SimulatedKeystrokesDialog.axaml index 4d80597..81b30a3 100644 --- a/YMouseButtonControl/Views/Dialogs/SimulatedKeystrokesDialog.axaml +++ b/YMouseButtonControl/Views/Dialogs/SimulatedKeystrokesDialog.axaml @@ -25,7 +25,7 @@ VerticalContentAlignment="Center" /> - + + + Mode 6 (repeat while mouse down) does not work on Linux. + + - + + + + + + + Suppress the original mouse click or not. + + Windows and macOS only. + + + - + - +