Skip to content

carnac

Created: 2017-08-17 13:31:42 -0700 Modified: 2021-01-02 08:47:13 -0800

This is for showing keyboard shortcuts on-screen (e.g. for streaming, presenting, or recording).

I run Carnac from here since I had to custom-build it: B:Codec sharpcarnacsrcCarnacbinDebugcarnac.exe

  • Clone repo
  • Open PowerShell to repo location
  • .build.ps1

Clone their git, then run

powershell -ExecutionPolicy bypass ./build.ps1 -ScriptArgs “—experimental”

The “—experimental” is needed thanks to this.

At that point, you’ll have “carnacdeploySquirrelReleasesSetup.exe” which can be run.

After that, I used Visual Studio Express 2013 to be able to view their XAML files. It didn’t seem to work before building.

Note: building through VS will put the executable in “carnacsrcCarnacbinDebugCarnac.exe”

Make sure you kill carnac.exe before building in VS, otherwise it will fail since the file is already open.

Modifying (with full Visual Studio)

Section titled Modifying (with full Visual Studio)

(note: my local copy of VS for Windows Desktop is here: “C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEWDExpress.exe”)

To modify the XAML, just add “Background=“Blue"" to stuff until you figure out what element you want to update.

Laying out shortcuts horizontally instead of vertically

Section titled Laying out shortcuts horizontally instead of vertically

Just copy/pasting the sections that changed here in KeyShowView.xaml:

<ListView Margin=“{Binding Settings.Margins}” HorizontalAlignment=“{Binding Settings.Alignment}”

VerticalAlignment=“Top” ItemsSource=“{Binding Source={StaticResource KeysViewSource}}”

Background=“Transparent” Focusable=“False” IsHitTestVisible=“False” BorderBrush=“Transparent”

BorderThickness=“0” ScrollViewer.VerticalScrollBarVisibility=“Hidden”

ScrollViewer.HorizontalScrollBarVisibility=“Hidden” MaxWidth=“550” Height=“150”>

<ListView.ItemsPanel>

<ItemsPanelTemplate>

<StackPanel VerticalAlignment=“Bottom” Orientation=“Horizontal”/>

</ItemsPanelTemplate>

</ListView.ItemsPanel>

Then under the StackPanel just beyond the <Image>

<ListBox

VerticalAlignment=“Stretch” HorizontalContentAlignment=“Center” ItemsSource=“{Binding Text, Mode=OneWay}”

FontWeight=“Bold” Focusable=“False” BorderBrush=“{x:Null}”

ScrollViewer.VerticalScrollBarVisibility=“Disabled” IsHitTestVisible=“False”>

I reduced the size of the Windows icon to 23x23 instead of 50x50.

I lowered the padding where it used to be Padding=“2,5” to “2,2” so that the icons would fit in the task bar.

This doesn’t involve rebuilding. Start Carnac, single-left-click the purple icon in the system tray, then resize the settings dialog so that you can see all of the offests:

This is probably because you hit ctrl+alt+P, which is the shortcut to silence Carnac. This happens to be the shortcut in Sublime 2 to change projects.

Can’t build because “error MSB4036: The “GetReferenceNeare stTargetFrameworkTask” task was not found.” (reference)

Section titled Can’t build because “error MSB4036: The “GetReferenceNeare stTargetFrameworkTask” task was not found.” (reference)

I ran this command from PowerShell

Start-Process “C:Program Files (x86)Microsoft Visual StudioInstallervs_installer.exe” -ArgumentList ‘modify —installPath “C:Program Files (x86)Microsoft Visual Studio2017BuildTools” —quiet —add Microsoft.VisualStudio.Component.NuGet.BuildTools —add Microsoft.Net.Component.4.5.TargetingPack —norestart —force’ -Wait -PassThru