Skip to content
Draft
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
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)

Expand Down
5 changes: 4 additions & 1 deletion src/Carnac.Logic/Carnac.Logic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
<Content Include="Keymaps\chrome.yml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Keymaps\kdenlive.yml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Keymaps\ncrunch.yml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -158,4 +161,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
125 changes: 125 additions & 0 deletions src/Carnac.Logic/Keymaps/kdenlive.yml
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions src/Carnac.Logic/Models/PopupSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
3 changes: 1 addition & 2 deletions src/Carnac.Logic/ScreenManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public IEnumerable<DetailedScreen> GetScreens()
{
s.RelativeWidth = 200 * (s.Width / maxWidth);
s.RelativeHeight = s.RelativeWidth * (s.Height / s.Width);
s.Top *= (s.RelativeHeight / s.Height);
}
}

Expand All @@ -79,4 +78,4 @@ public IEnumerable<DetailedScreen> GetScreens()
return screens;
}
}
}
}
34 changes: 33 additions & 1 deletion src/Carnac.Tests/ViewModels/ShellViewModelFacts.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<ISettingsProvider>();
var screenManager = Substitute.For<IScreenManager>();
var popupSettings = new PopupSettings
{
Screen = 2,
Placement = NotificationPlacement.TopRight
};
var screens = new List<DetailedScreen>
{
new DetailedScreen { Index = 1, Left = 0, Top = 0 },
new DetailedScreen { Index = 2, Left = 640, Top = 480 }
};

settingsService.GetSettings<PopupSettings>().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);
}
}
}
}
10 changes: 10 additions & 0 deletions src/Carnac/UI/KeyShowView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
}
}
3 changes: 2 additions & 1 deletion src/Carnac/UI/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ void PlaceScreen()
}

Settings.Left = SelectedScreen.Left;
Settings.Top = SelectedScreen.Top;
}
}
}
}
Loading