Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Carnac.Logic/Models/PopupSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public string SortDescription
[DefaultValue("RoyalBlue")]
public string RightClickColor { get; set; }

[DefaultValue("Yellow")]
public string ScrollClickColor { get; set; }

[DefaultValue(1)]
public double ClickStartScale { get; set; }

Expand Down
9 changes: 6 additions & 3 deletions src/Carnac.Logic/MouseMonitor/InterceptMouse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ private Keys MouseButtonsToKeys(MouseButtons button)

private void OnMouseClick(object sender, MouseEventArgs e)
{
bool alt = (Control.ModifierKeys & Keys.Alt) != 0;
bool control = (Control.ModifierKeys & Keys.Control) != 0;
bool shift = (Control.ModifierKeys & Keys.Shift) != 0;
observer.OnNext(new InterceptKeyEventArgs(
MouseButtonsToKeys(e.Button),
KeyDirection.Down,
Control.ModifierKeys == Keys.Alt,
Control.ModifierKeys == Keys.Control,
Control.ModifierKeys == Keys.Shift));
alt,
control,
shift));
}

private void OnMouseDoubleClick(object sender, MouseEventArgs e)
Expand Down
4 changes: 4 additions & 0 deletions src/Carnac/UI/KeyShowView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ private void OnMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
vm.Settings.ClickColor = vm.Settings.RightClickColor;
}
else if (e.Button == System.Windows.Forms.MouseButtons.Middle)
{
vm.Settings.ClickColor = vm.Settings.ScrollClickColor;
}
sb.Begin();
}

Expand Down
7 changes: 6 additions & 1 deletion src/Carnac/UI/PreferencesView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@
ItemsSource="{Binding AvailableColors}"
ItemTemplate="{StaticResource ColourPickerTemplate}" />
</ui:PreferencesField>
</StackPanel>
<ui:PreferencesField Header="Scroll Click Color">
<ComboBox SelectedItem="{Binding ScrollClickColor}"
ItemsSource="{Binding AvailableColors}"
ItemTemplate="{StaticResource ColourPickerTemplate}" />
</ui:PreferencesField>
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Grid.Row="1" Margin="0,5,5.333,5.333" Grid.Column="1">
<Button Width="150" Margin="0 0 5 0" Content="Reset to Defaults" Command="{Binding ResetToDefaultsCommand}" />
<Button Width="50" Content="Save" Command="{Binding SaveCommand}" />
Expand Down
9 changes: 9 additions & 0 deletions src/Carnac/UI/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public PreferencesViewModel(ISettingsProvider settingsProvider, IScreenManager s
LeftClickColor = availableColor;
if (Settings.RightClickColor == name)
RightClickColor = availableColor;
if (Settings.ScrollClickColor == name)
ScrollClickColor = availableColor;

AvailableColors.Add(availableColor);
}
Expand All @@ -56,6 +58,10 @@ public PreferencesViewModel(ISettingsProvider settingsProvider, IScreenManager s
{
RightClickColor = new AvailableColor("RoyalBlue", Colors.RoyalBlue);
}
if (ScrollClickColor == null)
{
ScrollClickColor = new AvailableColor("Yellow", Colors.RoyalBlue);
}


SaveCommand = new DelegateCommand(SaveSettings);
Expand Down Expand Up @@ -122,6 +128,8 @@ public string Components

public AvailableColor RightClickColor { get; set; }

public AvailableColor ScrollClickColor { get; set; }

void Visit()
{
try
Expand Down Expand Up @@ -162,6 +170,7 @@ void SaveSettings()
Settings.ItemBackgroundColor = ItemBackgroundColor.Name;
Settings.LeftClickColor = LeftClickColor.Name;
Settings.RightClickColor = RightClickColor.Name;
Settings.ScrollClickColor = ScrollClickColor.Name;
settingsProvider.SaveSettings(Settings);
}

Expand Down