diff --git a/README.md b/README.md index 9ee205e8..8b180068 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,24 @@ A keyboard logging and presentation utility for presentations, screencasts, and ### Installation -You can install the latest version of Carnac via [Chocolatey](https://chocolatey.org/): +There are several options to install the latest version of Carnac on Windows. -```ps -cinst carnac +#### [WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) + +```powershell +winget install --id code52.Carnac +``` + +#### [Chocolatey](https://chocolatey.org/) + +You can install the latest version of [Carnac](https://community.chocolatey.org/packages/carnac) via Chocolatey: + +```powershell +choco install carnac ``` +#### Manual setup + Alternatively, you can grab the latest zip file from [here](https://github.com/Code52/carnac/releases/latest), unpack it and run `Setup.exe`. **Note:** Carnac requires .NET 4.5.2 to work - you can install that from [here](https://www.microsoft.com/en-au/download/details.aspx?id=42643) if you don't have it already. @@ -28,29 +40,29 @@ The application will check for updates in the background, if a new version has b ### Usage -**Enabling silent mode** +#### Enabling silent mode If you want to stop `Carnac` from recording certain key strokes, you can enter _silent mode_ by pressing `Ctrl+Alt+P`. To exit _silent mode_ you simply press `Ctrl+Alt+P` again. ### Contributing -**Getting started with Git and GitHub** +#### Getting started with Git and GitHub - [Setting up Git for Windows and connecting to GitHub](http://help.github.com/win-set-up-git/) - [Forking a GitHub repository](http://help.github.com/fork-a-repo/) - [The simple guide to GIT guide](http://rogerdudler.github.com/git-guide/) - [Open an issue](https://github.com/Code52/carnac/issues) if you encounter a bug or have a suggestion for improvements/features -Once you're familiar with Git and GitHub, clone the repository and run the `.\build.cmd` script to compile the code and run all the unit tests. You can use this script to test your changes quickly. +Once you're familiar with Git and GitHub, clone the repository and run `.\build.ps1 -Target Run-Unit-Tests -Configuration Release` to compile the code and run the unit tests on Windows. ### Resources This blog series covers a series of refactorings which have recently happened in Carnac to make better use of Rx. If you are learning Rx and want to be shown through Carnac's codebase then this blog series may help you. -[Part 1 - Refactoring the InterceptKeys class](http://jake.ginnivan.net/blog/carnac-improvements/part-1/) -[Part 2 - Refactoring the MessageProvider class](http://jake.ginnivan.net/blog/carnac-improvements/part-2/) -[Part 3 - Introducing the MessageController class](http://jake.ginnivan.net/blog/carnac-improvements/part-3/) +1. [Part 1 - Refactoring the InterceptKeys class](http://jake.ginnivan.net/blog/carnac-improvements/part-1/) +1. [Part 2 - Refactoring the MessageProvider class](http://jake.ginnivan.net/blog/carnac-improvements/part-2/) +1. [Part 3 - Introducing the MessageController class](http://jake.ginnivan.net/blog/carnac-improvements/part-3/) ### Install Carnac with ClickOnce (Auto-update) diff --git a/src/Carnac.Logic/Carnac.Logic.csproj b/src/Carnac.Logic/Carnac.Logic.csproj index 915b663a..e9bcec24 100644 --- a/src/Carnac.Logic/Carnac.Logic.csproj +++ b/src/Carnac.Logic/Carnac.Logic.csproj @@ -127,6 +127,9 @@ Always + + Always + Always @@ -158,4 +161,4 @@ --> - \ No newline at end of file + diff --git a/src/Carnac.Logic/Keymaps/kdenlive.yml b/src/Carnac.Logic/Keymaps/kdenlive.yml new file mode 100644 index 00000000..b4e6c252 --- /dev/null +++ b/src/Carnac.Logic/Keymaps/kdenlive.yml @@ -0,0 +1,125 @@ +group: kdenlive +process: kdenlive + +# Reference: https://userbase.kde.org/Kdenlive/Manual/Useful_Information/Shortcuts + +shortcuts: + - name: Cut Clip + keys: + - Shift+R + - name: Play/Pause + keys: + - Space + - name: Play zone + keys: + - Ctrl+Space + - name: Render/Export + keys: + - Ctrl+Enter + - name: Switch Monitor + keys: + - T + - name: Forward + keys: + - L + - name: Rewind + keys: + - J + - name: Forward 1 frame + keys: + - Right + - name: Rewind 1 frame + keys: + - Left + - name: Forward 1 second + keys: + - Shift+Right + - name: Rewind 1 second + keys: + - Shift+Left + - name: Toggle Full Screen Mode + keys: + - Ctrl+Shift+F + - name: Go to Clip End + keys: + - End + - name: Go to Clip Start + keys: + - Home + - name: Go to Next Snap Point + keys: + - Alt+Right + - name: Go to Previous Snap Point + keys: + - Alt+Left + - name: Go to Project End + keys: + - Ctrl+End + - name: Go to Project Start + keys: + - Ctrl+Home + - name: Go to Zone End + keys: + - Shift+O + - name: Go to Zone Start + keys: + - Shift+I + - name: Group Clips + keys: + - Ctrl+G + - name: Ungroup Clips + keys: + - Ctrl+Shift+G + - name: Set Zone In + keys: + - I + - name: Set Zone Out + keys: + - O + - name: Ripple Delete + keys: + - Ctrl+X + - name: Open Project Settings + keys: + - Ctrl+N + - name: Spacer Tool + keys: + - M + - name: Selection Tool + keys: + - S + - name: Razor Tool + keys: + - X + - name: Insert Clip + keys: + - V + - name: Overwrite Clip + keys: + - B + - name: Lift + keys: + - Z + - name: Extract/Ripple Delete + keys: + - Shift+X + - name: Add subtitle + keys: + - Shift+S + - name: Align playhead to mouse position + keys: + - P + - name: Zoom In + keys: + - Ctrl+Oemplus + - Ctrl+Shift+Oemplus + - name: Zoom Out + keys: + - Ctrl+OemMinus + - Ctrl+Subtract + - name: Save + keys: + - Ctrl+S + - name: Save As + keys: + - Ctrl+Shift+S diff --git a/src/Carnac.Logic/Models/PopupSettings.cs b/src/Carnac.Logic/Models/PopupSettings.cs index b2be6486..dffada47 100644 --- a/src/Carnac.Logic/Models/PopupSettings.cs +++ b/src/Carnac.Logic/Models/PopupSettings.cs @@ -53,6 +53,25 @@ protected void OnLeftChanged(EventArgs e) if (handler != null) handler(this, e); } + double top; + public double Top + { + get { return top; } + set + { + top = value; + OnTopChanged(EventArgs.Empty); + } + } + + public event EventHandler TopChanged; + + protected void OnTopChanged(EventArgs e) + { + var handler = TopChanged; + if (handler != null) handler(this, e); + } + [NotifyProperty(AlsoNotifyFor = new[] { "Margins" })] public int TopOffset { get; set; } diff --git a/src/Carnac.Logic/ScreenManager.cs b/src/Carnac.Logic/ScreenManager.cs index e9378f18..44c41f90 100644 --- a/src/Carnac.Logic/ScreenManager.cs +++ b/src/Carnac.Logic/ScreenManager.cs @@ -70,7 +70,6 @@ public IEnumerable GetScreens() { s.RelativeWidth = 200 * (s.Width / maxWidth); s.RelativeHeight = s.RelativeWidth * (s.Height / s.Width); - s.Top *= (s.RelativeHeight / s.Height); } } @@ -79,4 +78,4 @@ public IEnumerable GetScreens() return screens; } } -} \ No newline at end of file +} diff --git a/src/Carnac.Tests/ViewModels/ShellViewModelFacts.cs b/src/Carnac.Tests/ViewModels/ShellViewModelFacts.cs index aa67ad12..2fedbdc7 100644 --- a/src/Carnac.Tests/ViewModels/ShellViewModelFacts.cs +++ b/src/Carnac.Tests/ViewModels/ShellViewModelFacts.cs @@ -1,5 +1,8 @@ -using Carnac.Logic; +using System.Collections.Generic; +using Carnac.Logic; +using Carnac.Logic.Enums; using Carnac.Logic.Models; +using Carnac.Logic.Native; using Carnac.UI; using NSubstitute; using SettingsProviderNet; @@ -85,5 +88,34 @@ public void the_settings_file_is_the_existing_instance() Assert.NotNull(Subject.Settings); } } + + public class when_positioning_notifications_on_a_selected_screen + { + [Fact] + public void selected_screen_left_and_top_are_copied_to_settings() + { + var settingsService = Substitute.For(); + var screenManager = Substitute.For(); + var popupSettings = new PopupSettings + { + Screen = 2, + Placement = NotificationPlacement.TopRight + }; + var screens = new List + { + new DetailedScreen { Index = 1, Left = 0, Top = 0 }, + new DetailedScreen { Index = 2, Left = 640, Top = 480 } + }; + + settingsService.GetSettings().Returns(popupSettings); + screenManager.GetScreens().Returns(screens); + + var subject = new PreferencesViewModel(settingsService, screenManager); + + Assert.Equal(640, subject.Settings.Left); + Assert.Equal(480, subject.Settings.Top); + Assert.Same(screens[1], subject.SelectedScreen); + } + } } } diff --git a/src/Carnac/UI/KeyShowView.xaml.cs b/src/Carnac/UI/KeyShowView.xaml.cs index 72abbdf7..ea3d34a2 100644 --- a/src/Carnac/UI/KeyShowView.xaml.cs +++ b/src/Carnac/UI/KeyShowView.xaml.cs @@ -36,6 +36,8 @@ protected override void OnSourceInitialized(EventArgs e) var vm = ((KeyShowViewModel)DataContext); Left = vm.Settings.Left; vm.Settings.LeftChanged += SettingsLeftChanged; + Top = vm.Settings.Top; + vm.Settings.TopChanged += SettingsTopChanged; WindowState = WindowState.Maximized; } @@ -92,5 +94,13 @@ void SettingsLeftChanged(object sender, EventArgs e) Left = vm.Settings.Left; WindowState = WindowState.Maximized; } + + void SettingsTopChanged(object sender, EventArgs e) + { + WindowState = WindowState.Normal; + var vm = ((KeyShowViewModel)DataContext); + Top = vm.Settings.Top; + WindowState = WindowState.Maximized; + } } } diff --git a/src/Carnac/UI/PreferencesViewModel.cs b/src/Carnac/UI/PreferencesViewModel.cs index 7eb14b5d..769cd388 100644 --- a/src/Carnac/UI/PreferencesViewModel.cs +++ b/src/Carnac/UI/PreferencesViewModel.cs @@ -172,6 +172,7 @@ void PlaceScreen() } Settings.Left = SelectedScreen.Left; + Settings.Top = SelectedScreen.Top; } } -} \ No newline at end of file +}