diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/Artemis/Artemis.Installer/Artemis.Installer.wixproj b/Artemis/Artemis.Installer/Artemis.Installer.wixproj deleted file mode 100644 index 4ecebec55..000000000 --- a/Artemis/Artemis.Installer/Artemis.Installer.wixproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - Debug - x86 - 3.10 - a34f9047-8464-4423-89ef-a2f43e089e93 - 2.0 - Artemis - Package - - - bin\$(Configuration)\ - obj\$(Configuration)\ - Debug - - - bin\$(Configuration)\ - obj\$(Configuration)\ - -arch x64 - False - - - HarvestPath=..\Artemis\bin\Release - - - - - - - - Artemis - {ed9997a2-e54c-4e9f-9350-62be672c3abe} - True - True - Binaries;Content;Satellites - INSTALLFOLDER - - - - - $(WixExtDir)\WixUtilExtension.dll - WixUtilExtension - - - $(WixExtDir)\WixUIExtension.dll - WixUIExtension - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs b/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs deleted file mode 100644 index 1148775d8..000000000 --- a/Artemis/Artemis.Installer/HeatGeneratedFileList.wxs +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis.Installer/Product.wxs b/Artemis/Artemis.Installer/Product.wxs deleted file mode 100644 index 5620cb154..000000000 --- a/Artemis/Artemis.Installer/Product.wxs +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed - - - - 1 - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVE="ALL" - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis.Installer/banner.bmp b/Artemis/Artemis.Installer/banner.bmp deleted file mode 100644 index c8c5a43ce..000000000 Binary files a/Artemis/Artemis.Installer/banner.bmp and /dev/null differ diff --git a/Artemis/Artemis.Installer/dialog.bmp b/Artemis/Artemis.Installer/dialog.bmp deleted file mode 100644 index 9be6abf76..000000000 Binary files a/Artemis/Artemis.Installer/dialog.bmp and /dev/null differ diff --git a/Artemis/Artemis.Installer/logo.ico b/Artemis/Artemis.Installer/logo.ico deleted file mode 100644 index e3f35618e..000000000 Binary files a/Artemis/Artemis.Installer/logo.ico and /dev/null differ diff --git a/Artemis/Artemis.sln b/Artemis/Artemis.sln deleted file mode 100644 index bf3546036..000000000 --- a/Artemis/Artemis.sln +++ /dev/null @@ -1,246 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis", "Artemis\Artemis.csproj", "{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Razer2Artemis", "Razer2Artemis\Razer2Artemis.vcxproj", "{39711909-C1D5-46CE-A9EA-2D561692EA47}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorBox", "ColorBox\ColorBox.csproj", "{40085232-ACED-4CBE-945B-90BA8153C151}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LogiLed2Artemis", "LogiLed2Artemis\LogiLed2Artemis.vcxproj", "{D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis86Wrapper", "Artemis86Wrapper\Artemis86Wrapper.csproj", "{47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LightFX2Artemis", "LightFX2Artemis\LightFX2Artemis.vcxproj", "{1A349CF5-2008-41E8-AC13-874CBBCDFA0A}" -EndProject -Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "Artemis.Installer", "Artemis.Installer\Artemis.Installer.wixproj", "{A34F9047-8464-4423-89EF-A2F43E089E93}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - CD_ROM|Any CPU = CD_ROM|Any CPU - CD_ROM|x64 = CD_ROM|x64 - CD_ROM|x86 = CD_ROM|x86 - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - DVD-5|Any CPU = DVD-5|Any CPU - DVD-5|x64 = DVD-5|x64 - DVD-5|x86 = DVD-5|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - SingleImage|Any CPU = SingleImage|Any CPU - SingleImage|x64 = SingleImage|x64 - SingleImage|x86 = SingleImage|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.Build.0 = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.ActiveCfg = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.Build.0 = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.ActiveCfg = Release|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.Build.0 = Release|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.ActiveCfg = Debug|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.Build.0 = Debug|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.ActiveCfg = Debug|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.Build.0 = Debug|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.Build.0 = Debug|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.ActiveCfg = Debug|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.Build.0 = Debug|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.ActiveCfg = Debug|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.Build.0 = Debug|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.Build.0 = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.ActiveCfg = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.Build.0 = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.ActiveCfg = Release|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.Build.0 = Release|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.Build.0 = Release|Any CPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.ActiveCfg = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.Build.0 = Release|x64 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.ActiveCfg = Release|x86 - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.Build.0 = Release|x86 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|Any CPU.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|Any CPU.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|x64.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|x64.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|x86.ActiveCfg = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.CD_ROM|x86.Build.0 = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Debug|x64.ActiveCfg = Debug|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Debug|x64.Build.0 = Debug|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Debug|x86.ActiveCfg = Debug|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Debug|x86.Build.0 = Debug|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|Any CPU.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|Any CPU.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|x64.ActiveCfg = Debug|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|x64.Build.0 = Debug|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|x86.ActiveCfg = Debug|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.DVD-5|x86.Build.0 = Debug|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Release|Any CPU.ActiveCfg = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Release|x64.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Release|x64.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Release|x86.ActiveCfg = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.Release|x86.Build.0 = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|Any CPU.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|Any CPU.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|x64.ActiveCfg = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|x64.Build.0 = Release|x64 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|x86.ActiveCfg = Release|Win32 - {39711909-C1D5-46CE-A9EA-2D561692EA47}.SingleImage|x86.Build.0 = Release|Win32 - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|Any CPU.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|x64.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|x64.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|x86.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.CD_ROM|x86.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|x64.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|x64.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|x86.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Debug|x86.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|Any CPU.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|x64.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|x64.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|x86.ActiveCfg = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.DVD-5|x86.Build.0 = Debug|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|Any CPU.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|x64.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|x64.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|x86.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.Release|x86.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|Any CPU.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|x64.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|x64.Build.0 = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|x86.ActiveCfg = Release|Any CPU - {40085232-ACED-4CBE-945B-90BA8153C151}.SingleImage|x86.Build.0 = Release|Any CPU - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|Any CPU.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|Any CPU.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|x64.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|x64.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|x86.ActiveCfg = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.CD_ROM|x86.Build.0 = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Debug|x64.ActiveCfg = Debug|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Debug|x64.Build.0 = Debug|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Debug|x86.ActiveCfg = Debug|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Debug|x86.Build.0 = Debug|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|Any CPU.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|Any CPU.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|x64.ActiveCfg = Debug|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|x64.Build.0 = Debug|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|x86.ActiveCfg = Debug|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.DVD-5|x86.Build.0 = Debug|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Release|Any CPU.ActiveCfg = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Release|x64.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Release|x64.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Release|x86.ActiveCfg = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.Release|x86.Build.0 = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|Any CPU.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|Any CPU.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|x64.ActiveCfg = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|x64.Build.0 = Release|x64 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|x86.ActiveCfg = Release|Win32 - {D2EDB8F3-F0CB-4670-B472-0B46D5800D2C}.SingleImage|x86.Build.0 = Release|Win32 - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|Any CPU.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|x64.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|x64.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|x86.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.CD_ROM|x86.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|x64.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|x64.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|x86.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Debug|x86.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|Any CPU.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|x64.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|x64.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|x86.ActiveCfg = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.DVD-5|x86.Build.0 = Debug|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|Any CPU.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|x64.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|x64.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|x86.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.Release|x86.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|Any CPU.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x64.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x64.Build.0 = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x86.ActiveCfg = Release|Any CPU - {47A9BBFD-4BEA-4D7D-8AB7-896E760B2CF2}.SingleImage|x86.Build.0 = Release|Any CPU - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|Any CPU.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|Any CPU.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x64.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x64.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x86.ActiveCfg = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.CD_ROM|x86.Build.0 = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x64.ActiveCfg = Debug|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x64.Build.0 = Debug|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x86.ActiveCfg = Debug|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Debug|x86.Build.0 = Debug|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|Any CPU.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|Any CPU.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x64.ActiveCfg = Debug|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x64.Build.0 = Debug|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x86.ActiveCfg = Debug|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.DVD-5|x86.Build.0 = Debug|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|Any CPU.ActiveCfg = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x64.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x64.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x86.ActiveCfg = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.Release|x86.Build.0 = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|Any CPU.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|Any CPU.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x64.ActiveCfg = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x64.Build.0 = Release|x64 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.ActiveCfg = Release|Win32 - {1A349CF5-2008-41E8-AC13-874CBBCDFA0A}.SingleImage|x86.Build.0 = Release|Win32 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|Any CPU.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|Any CPU.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x64.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x64.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x86.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.CD_ROM|x86.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|Any CPU.ActiveCfg = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x64.ActiveCfg = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x86.ActiveCfg = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Debug|x86.Build.0 = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|Any CPU.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|Any CPU.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x64.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x64.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x86.ActiveCfg = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.DVD-5|x86.Build.0 = Debug|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|Any CPU.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x64.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x86.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.Release|x86.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|Any CPU.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|Any CPU.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x64.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x64.Build.0 = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x86.ActiveCfg = Release|x86 - {A34F9047-8464-4423-89EF-A2F43E089E93}.SingleImage|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7F70A235-016F-4E1A-85B7-B66102F15535} - EndGlobalSection -EndGlobal diff --git a/Artemis/Artemis/App.config b/Artemis/Artemis/App.config deleted file mode 100644 index cedff3614..000000000 --- a/Artemis/Artemis/App.config +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis/App.xaml b/Artemis/Artemis/App.xaml deleted file mode 100644 index 15a67464a..000000000 --- a/Artemis/Artemis/App.xaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis/App.xaml.cs b/Artemis/Artemis/App.xaml.cs deleted file mode 100644 index f7f13e188..000000000 --- a/Artemis/Artemis/App.xaml.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Windows; -using System.Windows.Threading; -using Artemis.Utilities; -using NLog; -using WpfExceptionViewer; - -namespace Artemis -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - public App() - { - InitializeComponent(); - } - - public bool DoHandle { get; set; } - - protected override void OnExit(ExitEventArgs e) - { - base.OnExit(e); - Environment.Exit(0); - } - - private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) - { - // Get rid of the keyboard hook in case of a crash, otherwise input freezes up system wide until Artemis is gone - InputHook.Stop(); - - if (DoHandle) - { - GetArtemisExceptionViewer(e.Exception).ShowDialog(); - e.Handled = true; - } - else - { - GetArtemisExceptionViewer(e.Exception).ShowDialog(); - e.Handled = false; - } - } - - public static ExceptionViewer GetArtemisExceptionViewer(Exception e) - { - var logger = LogManager.GetCurrentClassLogger(); - logger.Fatal(e, "Unhandled exception, showing dialog and shutting down."); - return new ExceptionViewer("An unexpected error occurred in Artemis.", e) - { - Title = "Artemis - Exception :c", - Height = 400, - Width = 800 - }; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj deleted file mode 100644 index df418eb0a..000000000 --- a/Artemis/Artemis/Artemis.csproj +++ /dev/null @@ -1,1111 +0,0 @@ - - - - - Debug - AnyCPU - {ED9997A2-E54C-4E9F-9350-62BE672C3ABE} - WinExe - Properties - Artemis - Artemis - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - - - - - - - false - - - - C:\Users\Robert\Desktop\Artemis builds\ - true - Disk - false - Foreground - 7 - Days - false - false - true - https://github.com/SpoinkyNL/Artemis/wiki/Frequently-Asked-Questions-%28FAQ%29 - Artemis - Artemis - 0 - 1.3.3.0 - false - true - true - true - - - x64 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - true - - - x64 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - EAC088BE27A2DE790AE6F37A020409F4A1B5EC0E - - - Artemis_TemporaryKey.pfx - - - false - - - false - - - Resources\logo.ico - - - true - bin\x86\Debug\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - true - - - true - bin\Debug\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - true - - - bin\Release\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - true - true - Auto - true - - - - app.manifest - - - LocalIntranet - - - - False - lib\AssettoCorsaSharedMemory.dll - - - ..\packages\Betwixt.1.4.1\lib\net35\Betwixt.dll - True - - - ..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll - - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.dll - - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll - - - ..\packages\Colore.5.2.0\lib\net35\Corale.Colore.dll - - - ..\packages\CSCore.1.2.1.2\lib\net35-client\CSCore.dll - - - ..\packages\CUE.NET.1.2.0\lib\net45\CUE.NET.dll - - - ..\packages\DynamicExpresso.Core.1.3.4.7\lib\net40\DynamicExpresso.Core.dll - - - ..\packages\MouseKeyHook.5.4.0\lib\net40\Gma.System.MouseKeyHook.dll - True - - - ..\packages\gong-wpf-dragdrop.0.1.4.3\lib\net40\GongSolutions.Wpf.DragDrop.dll - True - - - ..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll - True - - - ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll - True - - - ..\packages\MahApps.Metro.1.4.3\lib\net45\MahApps.Metro.dll - - - ..\packages\MoonSharp.2.0.0.0\lib\net40-client\MoonSharp.Interpreter.dll - True - - - ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll - True - - - ..\packages\Ninject.Extensions.Conventions.3.2.0.0\lib\net45-full\Ninject.Extensions.Conventions.dll - True - - - ..\packages\Ninject.Extensions.Logging.3.2.3.0\lib\net45-full\Ninject.Extensions.Logging.dll - True - - - ..\packages\Ninject.Extensions.Logging.nlog4.3.2.3.0\lib\net45-full\Ninject.Extensions.Logging.NLog4.dll - True - - - ..\packages\NLog.4.4.12\lib\net45\NLog.dll - - - ..\packages\Pcap.Net.x64.1.0.4.1\lib\net45\PcapDotNet.Base.dll - - - ..\packages\Pcap.Net.x64.1.0.4.1\lib\net45\PcapDotNet.Core.dll - - - ..\packages\Pcap.Net.x64.1.0.4.1\lib\net45\PcapDotNet.Core.Extensions.dll - - - ..\packages\Pcap.Net.x64.1.0.4.1\lib\net45\PcapDotNet.Packets.dll - - - ..\packages\Process.NET.1.0.8\lib\Process.NET.dll - True - - - ..\packages\SharpDX.4.0.1\lib\net45\SharpDX.dll - - - ..\packages\SharpDX.Direct3D9.4.0.1\lib\net45\SharpDX.Direct3D9.dll - - - ..\packages\SpotifyAPI-NET.2.17.0\lib\SpotifyAPI.dll - - - - - - - - - - - - - ..\packages\Caliburn.Micro.3.2.0\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - 4.0 - - - ..\packages\WpfExceptionViewer.1.0.0.0\lib\VioletTape.WpfExceptionViewer.dll - True - - - - - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - LoggingControl.xaml - - - - - - - - - - - - - - - - - - - - - - - - MarkdownDialog.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AssettoCorsaView.xaml - - - - - - FormulaOne2017View.xaml - - - - - - - - TerrariaView.xaml - - - - - - - - - - - - - - - - - - - - EurotruckSimulator2View.xaml - - - - - - - GtaVView.xaml - - - - - - - - LightFxView.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ProjectCarsView.xaml - - - - - - - UnrealTournamentView.xaml - - - - WoWView.xaml - - - - - - - - - - OverlayProfileView.xaml - - - - - - - - - - - - - - - - - AmbientLightPropertiesView.xaml - - - - - - - - - - - - - - - - - - ConicalBrushPropertiesView.xaml - - - - - - - - - - - - - - - AudioPropertiesView.xaml - - - - - GenericPropertiesView.xaml - - - - - - KeyPressPropertiesView.xaml - - - - - MousematPropertiesView.xaml - - - - - - - - - - - - - - - - - - - LuaWindowView.xaml - - - - - - - - - - - - - - - - - - - - - - - - - BubblesView.xaml - - - - - GeneralProfileView.xaml - - - - - - - - - - - - OverwatchView.xaml - - - - - - - - TheDivisionView.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DebugView.xaml - - - GeneralView.xaml - - - FlyoutSettingsView.xaml - - - GamesView.xaml - - - CounterStrikeView.xaml - - - Dota2View.xaml - - - RocketLeagueView.xaml - - - Witcher3View.xaml - - - EventPropertiesView.xaml - - - FolderPropertiesView.xaml - - - HeadsetPropertiesView.xaml - - - KeyboardPropertiesView.xaml - - - LayerKeybindView.xaml - - - LayerConditionView.xaml - - - LayerDynamicPropertiesView.xaml - - - LayerEditorView.xaml - - - MousePropertiesView.xaml - - - OverlaysView.xaml - - - LayerTweenView.xaml - - - ProfileEditorView.xaml - - - ShellView.xaml - - - SystemTrayView.xaml - - - WelcomeView.xaml - - - - - Code - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - Designer - - - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - Designer - - - - - - - - Always - - - Always - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - - - - - - - - - Designer - - - - - - False - Microsoft .NET Framework 4.5.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - {40085232-aced-4cbe-945b-90ba8153c151} - ColorBox - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - if $(ConfigurationName) == Release ( - attrib +r Artemis.pdb - del *.pdb - attrib -r Artemis.pdb - echo Access denied is intended, see post build event -) - - - \ No newline at end of file diff --git a/Artemis/Artemis/ArtemisBootstrapper.cs b/Artemis/Artemis/ArtemisBootstrapper.cs deleted file mode 100644 index 65b9c478c..000000000 --- a/Artemis/Artemis/ArtemisBootstrapper.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; -using Artemis.DAL; -using Artemis.InjectionModules; -using Artemis.Services; -using Artemis.Settings; -using Artemis.Utilities; -using Artemis.Utilities.ActiveWindowDetection; -using Artemis.Utilities.Converters; -using Artemis.Utilities.DataReaders; -using Artemis.ViewModels; -using Caliburn.Micro; -using Newtonsoft.Json; -using Ninject; - -namespace Artemis -{ - public class ArtemisBootstrapper : BootstrapperBase - { - private IKernel _kernel; - - public ArtemisBootstrapper() - { - // Make sure the data folder exists - GeneralHelpers.SetupDataFolder(); - - // Start logging before anything else - Logging.SetupLogging(SettingsProvider.Load().LogLevel); - // Restore DDLs before interacting with any SDKs - DllManager.RestoreLogitechDll(); - // Check compatibility before trying to boot further - CompatibilityService.CheckRivaTuner(); - Updater.CleanSquirrel(); - - Initialize(); - BindSpecialValues(); - - AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException; - } - - private void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs) - { - // Get rid of the keyboard hook in case of a crash, otherwise input freezes up system wide until Artemis is gone - InputHook.Stop(); - } - - private void BindSpecialValues() - { - MessageBinder.SpecialValues.Add("$scaledmousex", ctx => - { - var img = ctx.Source as Image; - var input = ctx.Source as IInputElement; - var e = ctx.EventArgs as MouseEventArgs; - - // If there is an image control, get the scaled position - if (img != null && e != null) - { - var position = e.GetPosition(img); - return (int) (img.Source.Width * (position.X / img.ActualWidth)); - } - - // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen - if (e != null && input != null) - return e.GetPosition(input).X; - - // Return 0 if no processing could be done - return 0; - }); - MessageBinder.SpecialValues.Add("$scaledmousey", ctx => - { - var img = ctx.Source as Image; - var input = ctx.Source as IInputElement; - var e = ctx.EventArgs as MouseEventArgs; - - // If there is an image control, get the scaled position - if (img != null && e != null) - { - var position = e.GetPosition(img); - return (int) (img.Source.Width * (position.Y / img.ActualWidth)); - } - - // If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen - if (e != null && input != null) - return e.GetPosition(input).Y; - - // Return 0 if no processing could be done - return 0; - }); - } - - protected override void Configure() - { - _kernel = new StandardKernel(new BaseModules(), new ManagerModules()); - - _kernel.Bind().To().InSingletonScope(); - _kernel.Bind().To().InSingletonScope(); - - // Configure JSON.NET - var settings = new JsonSerializerSettings - { - TypeNameHandling = TypeNameHandling.Auto, - ContractResolver = _kernel.Get() - }; - JsonConvert.DefaultSettings = () => settings; - - //TODO DarthAffe 17.12.2016: Is this the right location for this? - //TODO Move to Mainmanager and make disposable - ActiveWindowHelper.SetActiveWindowDetectionType(SettingsProvider.Load().ActiveWindowDetection); - } - - protected override void OnExit(object sender, EventArgs e) - { - _kernel.Dispose(); - ActiveWindowHelper.Dispose(); - base.OnExit(sender, e); - } - - protected override object GetInstance(Type service, string key) - { - if (service == null) - throw new ArgumentNullException(nameof(service)); - - return _kernel.Get(service); - } - - protected override IEnumerable GetAllInstances(Type service) - { - return _kernel.GetAll(service); - } - - protected override void BuildUp(object instance) - { - _kernel.Inject(instance); - } - - protected override void OnStartup(object sender, StartupEventArgs e) - { - DisplayRootViewFor(); - InputHook.Start(); - } - } -} diff --git a/Artemis/Artemis/Controls/Log/LoggingControl.xaml b/Artemis/Artemis/Controls/Log/LoggingControl.xaml deleted file mode 100644 index 85c8b6ff9..000000000 --- a/Artemis/Artemis/Controls/Log/LoggingControl.xaml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs b/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs deleted file mode 100644 index 6809192cf..000000000 --- a/Artemis/Artemis/Controls/Log/LoggingControl.xaml.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.ObjectModel; -using System.Windows.Controls; -using Artemis.Utilities; -using NLog; - -namespace Artemis.Controls.Log -{ - /// - /// Interaction logic for LoggingControl.xaml - /// - public partial class LoggingControl : UserControl - { - public LoggingControl() - { - LogCollection = new ObservableCollection(); - - InitializeComponent(); - - // init memory queue - Logging.ClearLoggingEvent(); - Logging.MemoryEvent += EventReceived; - } - - public static ObservableCollection LogCollection { get; set; } - - private async void EventReceived(LogEventInfo message) - { - await Dispatcher.InvokeAsync(() => - { - if (LogCollection.Count >= 50) - LogCollection.RemoveAt(0); - - LogCollection.Add(message); - }); - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/Controls/Log/MemoryEventTarget.cs b/Artemis/Artemis/Controls/Log/MemoryEventTarget.cs deleted file mode 100644 index acbe7690e..000000000 --- a/Artemis/Artemis/Controls/Log/MemoryEventTarget.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using NLog; -using NLog.Targets; - -namespace Artemis.Controls.Log -{ - public class MemoryEventTarget : Target - { - public event Action EventReceived; - - /// - /// Notifies listeners about new event - /// - /// The logging event. - protected override void Write(LogEventInfo logEvent) - { - EventReceived?.Invoke(logEvent); - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DAL/ProfileProvider.cs b/Artemis/Artemis/DAL/ProfileProvider.cs deleted file mode 100644 index 476482dba..000000000 --- a/Artemis/Artemis/DAL/ProfileProvider.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Reflection; -using Artemis.DeviceProviders; -using Artemis.Modules.Abstract; -using Artemis.Profiles; -using Artemis.Profiles.Layers.Types.Keyboard; -using Artemis.Properties; -using Artemis.Utilities; -using MoonSharp.Interpreter; -using Newtonsoft.Json; -using NLog; - -namespace Artemis.DAL -{ - public static class ProfileProvider - { - public static readonly string ProfileFolder = GeneralHelpers.DataFolder + "profiles\\"; - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private static bool _installedDefaults; - - static ProfileProvider() - { - // Configure MoonSharp - UserData.RegisterAssembly(); - CheckProfiles(); - InstallDefaults(); - } - - public static List GetProfileNames(KeyboardProvider keyboard, ModuleModel module) - { - if (keyboard == null || module == null) - return null; - return ReadProfiles(keyboard.Slug + "/" + module.Name).Select(p => p.Name).ToList(); - } - - public static ProfileModel GetProfile(KeyboardProvider keyboard, ModuleModel module, string name) - { - if (keyboard == null || module == null) - return null; - return ReadProfiles(keyboard.Slug + "/" + module.Name).FirstOrDefault(p => p.Name == name); - } - - public static bool IsProfileUnique(ProfileModel profileModel) - { - var existing = ReadProfiles(profileModel.KeyboardSlug + "/" + profileModel.GameName); - return !existing.Contains(profileModel); - } - - /// - /// Adds or update the given profile. - /// Updates occur when a profile with the same name and game exist. - /// - /// The profile to add or update - public static void AddOrUpdate(ProfileModel prof) - { - if (prof == null) - throw new ArgumentNullException(nameof(prof)); - - lock (prof) - { - // Store the file - if (!(prof.GameName?.Length > 1) || !(prof.KeyboardSlug?.Length > 1) || !(prof.Slug?.Length > 1)) - throw new ArgumentException("Profile is invalid. Name, GameName and KeyboardSlug are required"); - - var path = ProfileFolder + $"{prof.KeyboardSlug}\\{prof.GameName}"; - if (!Directory.Exists(path)) - Directory.CreateDirectory(path); - - string json; - - // Should saving fail for whatever reason, catch the exception and log it - // But DON'T touch the profile file. - try - { - json = JsonConvert.SerializeObject(prof, Formatting.Indented); - } - catch (Exception e) - { - Logger.Error(e, "Couldn't save profile '{0}.json'", prof.Slug); - return; - } - - File.WriteAllText(path + $"\\{prof.Slug}.json", json); - Logger.Debug("Saved profile {0}/{1}/{2}", prof.KeyboardSlug, prof.GameName, prof.Name); - } - } - - /// - /// Renames the profile on the model and filesystem - /// - /// The profile to rename - /// The new name - public static void RenameProfile(ProfileModel profile, string name) - { - if (string.IsNullOrEmpty(name)) - return; - - // Store the profile path before it is renamed - var oldPath = ProfileFolder + $"{profile.KeyboardSlug}\\{profile.GameName}\\{profile.Slug}.json"; - - // Update the profile, creating a new file - profile.Name = name; - AddOrUpdate(profile); - - // Remove the file with the old name - if (File.Exists(oldPath)) - File.Delete(oldPath); - } - - public static void DeleteProfile(ProfileModel prof) - { - // Remove the file - var path = ProfileFolder + $"{prof.KeyboardSlug}\\{prof.GameName}\\{prof.Slug}.json"; - if (File.Exists(path)) - File.Delete(path); - } - - /// - /// Attempts to load a profile from a given path - /// - /// The absolute path to load the profile from - /// The loaded profile, or null if invalid - public static ProfileModel LoadProfileIfValid(string path) - { - try - { - var prof = JsonConvert.DeserializeObject(File.ReadAllText(path)); - if (prof == null) - return null; - if (prof.GameName.Length < 1 || prof.KeyboardSlug.Length < 1 || prof.Name.Length < 1) - return null; - return prof; - } - catch (JsonException) - { - return null; - } - } - - /// - /// Exports the given profile to the provided path in JSON - /// - /// The profile to export - /// The path to save the profile to - public static void ExportProfile(ProfileModel prof, string path) - { - var json = JsonConvert.SerializeObject(prof); - File.WriteAllText(path, json); - } - - public static void InsertGif(string moduleName, string profileName, string layerName, Bitmap gifFile, string fileName) - { - var directories = new DirectoryInfo(ProfileFolder).GetDirectories(); - var profiles = new List(); - foreach (var directoryInfo in directories) - profiles.AddRange(ReadProfiles(directoryInfo.Name + "\\" + moduleName).Where(d => d.Name == profileName)); - - // Extract the GIF file - var gifDir = GeneralHelpers.DataFolder + "gifs"; - Directory.CreateDirectory(gifDir); - var gifPath = gifDir + $"\\{fileName}.gif"; - if (!File.Exists(gifPath)) - gifFile.Save(gifPath); - - foreach (var profile in profiles) - { - var gifLayer = profile.GetLayers().FirstOrDefault(l => l.Name == layerName); - if (gifLayer == null) - continue; - - ((KeyboardPropertiesModel) gifLayer.Properties).GifFile = gifPath; - AddOrUpdate(profile); - } - } - - public static List ReadProfiles(string subDirectory) - { - var profiles = new List(); - var directory = ProfileFolder + subDirectory; - if (!Directory.Exists(directory)) - return profiles; - - // Create the directory structure - var profilePaths = Directory.GetFiles(directory, "*.json", SearchOption.AllDirectories); - - // Parse the JSON files into objects and add them if they are valid - foreach (var path in profilePaths) - try - { - var prof = LoadProfileIfValid(path); - if (prof == null) - continue; - - // Only add unique profiles - if (profiles.Any(p => p.GameName == prof.GameName && p.Name == prof.Name && p.KeyboardSlug == prof.KeyboardSlug)) - Logger.Info("Didn't load duplicate profile: {0}", path); - else - profiles.Add(prof); - } - catch (Exception e) - { - Logger.Error("Failed to load profile: {0} - {1}", path, e); - } - return profiles; - } - - /// - /// Unpacks the default profiles into the profile directory - /// - private static void InstallDefaults() - { - try - { - // Only install the defaults once per session - if (_installedDefaults) - return; - _installedDefaults = true; - - // Load the ZIP from resources - var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Artemis.Resources.Keyboards.default-profiles.zip"); - - // Extract it over the old defaults in case one was updated - if (stream == null) - return; - var archive = new ZipArchive(stream); - archive.ExtractToDirectory(ProfileFolder, true); - - InsertGif("GeneralProfile", "Demo (duplicate to keep changes)", "GIF", Resources.demo_gif, "demo-gif"); - } - catch (IOException e) - { - Logger.Warn(e, "Failed to place default profiles, perhaps there are two instances of Artemis " + - "starting at the same time?"); - } - } - - /// - /// Makes sure the profile directory structure is in order and places default profiles - /// - private static void CheckProfiles() - { - // Create the directory structure - if (Directory.Exists(ProfileFolder)) - return; - - Directory.CreateDirectory(ProfileFolder); - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DAL/SettingsProvider.cs b/Artemis/Artemis/DAL/SettingsProvider.cs deleted file mode 100644 index 32330d863..000000000 --- a/Artemis/Artemis/DAL/SettingsProvider.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Artemis.Settings; -using Artemis.Utilities; -using Newtonsoft.Json; -using NLog; - -namespace Artemis.DAL -{ - public static class SettingsProvider - { - private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); - private static readonly string SettingsFolder = GeneralHelpers.DataFolder + "settings\\"; - private static readonly List Settings = new List(); - - /// - /// Loads settings with the given name from the filesystem - /// - /// - public static T Load() where T : new() - { - if (!AreSettings(typeof(T))) - throw new ArgumentException("Type doesn't implement IArtemisSettings"); - - // Attempt to load from memory first - var inMemory = Settings.FirstOrDefault(s => s.GetType() == typeof(T)); - if (inMemory != null) - return (T) inMemory; - - CheckSettings(); - - try - { - var loadSettings = (IArtemisSettings) JsonConvert.DeserializeObject(File.ReadAllText(SettingsFolder + $"{typeof(T)}.json")); - if (loadSettings == null) - { - loadSettings = (IArtemisSettings) new T(); - loadSettings.Reset(true); - } - - Settings.Add(loadSettings); - return (T) loadSettings; - } - catch (Exception e) - { - Logger.Error(e, "Couldn't load settings '{0}.json'", typeof(T)); - - // Not sure about this, I've seen prettier code - var loadSettings = (IArtemisSettings) new T(); - loadSettings.Reset(true); - Settings.Add(loadSettings); - return (T) loadSettings; - } - } - - /// - /// Saves the settings object to the filesystem - /// - /// - public static void Save(IArtemisSettings artemisSettings) - { - CheckSettings(); - - string json; - // Should saving fail for whatever reason, catch the exception and log it - // But DON'T touch the settings file. - try - { - json = JsonConvert.SerializeObject(artemisSettings, Formatting.Indented); - } - catch (Exception e) - { - Logger.Error(e, "Couldn't save settings '{0}.json'", artemisSettings.GetType()); - return; - } - - File.WriteAllText(SettingsFolder + $"{artemisSettings.GetType()}.json", json); - } - - /// - /// Ensures the settings folder exists - /// - private static void CheckSettings() - { - if (!Directory.Exists(SettingsFolder)) - Directory.CreateDirectory(SettingsFolder); - } - - /// - /// Checks to see if the given type is a setting - /// - /// - /// - private static bool AreSettings(Type t) - { - return typeof(IArtemisSettings).IsAssignableFrom(t); - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Artemis/NoneKeyboard.cs b/Artemis/Artemis/DeviceProviders/Artemis/NoneKeyboard.cs deleted file mode 100644 index c2221c6c7..000000000 --- a/Artemis/Artemis/DeviceProviders/Artemis/NoneKeyboard.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Drawing; -using System.Windows; -using System.Windows.Forms; -using Artemis.Properties; - -namespace Artemis.DeviceProviders.Artemis -{ - public class NoneKeyboard : KeyboardProvider - { - public NoneKeyboard() - { - Name = "None"; - Slug = "none"; - CantEnableText = "Waaaaah, this should not be happening!"; - Height = 1; - Width = 1; - PreviewSettings = new PreviewSettings(new Rect(), Resources.none); - } - - public override void Disable() - { - } - - public override bool CanEnable() - { - return true; - } - - public override void Enable() - { - } - - public override void DrawBitmap(Bitmap bitmap) - { - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - return null; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProL.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProL.cs deleted file mode 100644 index c84f7d4d4..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProL.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Drawing; -using System.Linq; -using System.Threading; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.CoolerMaster.Utilities; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Properties; -using Artemis.Settings; -using Artemis.Utilities; - -namespace Artemis.DeviceProviders.CoolerMaster -{ - public class MasterkeysProL : KeyboardProvider - { - private GeneralSettings _generalSettings; - - public MasterkeysProL() - { - Name = "CM Masterkeys Pro L"; - Slug = "cm-masterkeys-pro-l"; - - CantEnableText = "Couldn't connect to your CM Masterkeys Pro L.\n" + - "Please check your cables and try updating your CM software.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - - Height = 6; - Width = 22; - - PreviewSettings = new PreviewSettings(new Rect(17, 13, 812, 219), Resources.masterkeys_pro_l); - _generalSettings = SettingsProvider.Load(); - } - - public override void Disable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_L); - CmSdk.EnableLedControl(false); - Thread.Sleep(500); - } - - public override bool CanEnable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_L); - - // Doesn't seem reliable but better than nothing I suppose - return CmSdk.IsDevicePlug(); - } - - public override void Enable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_L); - CmSdk.EnableLedControl(true); - } - - public override void DrawBitmap(Bitmap bitmap) - { - // Resize the bitmap - using (var b = ImageUtilities.ResizeImage(bitmap, Width, Height)) - { - // Create an empty matrix - var matrix = new COLOR_MATRIX {KeyColor = new KEY_COLOR[6, 22]}; - - // Map the bytes to the matix - for (var x = 0; x < Width; x++) - { - for (var y = 0; y < Height; y++) - { - var c = b.GetPixel(x, y); - if (c.R != 0) - Console.WriteLine(); - matrix.KeyColor[y, x] = new KEY_COLOR(c.R, c.G, c.B); - } - } - - // Send the matrix to the keyboard - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_L); - CmSdk.SetAllLedColor(matrix); - } - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - switch (_generalSettings.Layout) - { - case "Qwerty": - return KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - case "Qwertz": - return KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - default: - return KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - } - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProM.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProM.cs deleted file mode 100644 index 580da1e0a..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProM.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Drawing; -using System.Linq; -using System.Threading; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.CoolerMaster.Utilities; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Properties; -using Artemis.Settings; -using Artemis.Utilities; - -namespace Artemis.DeviceProviders.CoolerMaster -{ - public class MasterkeysProM : KeyboardProvider - { - private GeneralSettings _generalSettings; - - public MasterkeysProM() - { - Name = "CM Masterkeys Pro M"; - Slug = "cm-masterkeys-pro-m"; - - CantEnableText = "Couldn't connect to your CM Masterkeys Pro M.\n" + - "Please check your cables and try updating your CM software.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - - Height = 6; - Width = 19; - - PreviewSettings = new PreviewSettings(new Rect(11, 10, 634, 215), Resources.masterkeys_pro_m); - _generalSettings = SettingsProvider.Load(); - } - - public override void Disable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_M); - CmSdk.EnableLedControl(false); - Thread.Sleep(500); - } - - public override bool CanEnable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_M); - - // Doesn't seem reliable but better than nothing I suppose - return CmSdk.IsDevicePlug(); - } - - public override void Enable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_M); - CmSdk.EnableLedControl(true); - } - - public override void DrawBitmap(Bitmap bitmap) - { - // Resize the bitmap - using (var b = ImageUtilities.ResizeImage(bitmap, Width, Height)) - { - // Create an empty matrix - var matrix = new COLOR_MATRIX {KeyColor = new KEY_COLOR[6, 22]}; - - // Map the bytes to the matix - for (var x = 0; x < Width; x++) - { - for (var y = 0; y < Height; y++) - { - var c = b.GetPixel(x, y); - if (c.R != 0) - Console.WriteLine(); - matrix.KeyColor[y, x] = new KEY_COLOR(c.R, c.G, c.B); - } - } - - // Send the matrix to the keyboard - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_M); - CmSdk.SetAllLedColor(matrix); - } - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - switch (_generalSettings.Layout) - { - case "Qwerty": - return KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - case "Qwertz": - return KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - default: - return KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - } - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProS.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProS.cs deleted file mode 100644 index 22bf231e0..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/MasterkeysProS.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.Drawing; -using System.Linq; -using System.Threading; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.CoolerMaster.Utilities; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Properties; -using Artemis.Settings; -using Artemis.Utilities; - -namespace Artemis.DeviceProviders.CoolerMaster -{ - public class MasterkeysProS : KeyboardProvider - { - private GeneralSettings _generalSettings; - - public MasterkeysProS() - { - Name = "CM Masterkeys Pro S"; - Slug = "cm-masterkeys-pro-s"; - - CantEnableText = "Couldn't connect to your CM Masterkeys Pro S.\n" + - "Please check your cables and try updating your CM software.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - - Height = 6; - Width = 18; - - PreviewSettings = new PreviewSettings(new Rect(13, 12, 657, 219), Resources.masterkeys_pro_s); - _generalSettings = SettingsProvider.Load(); - } - - public override void Disable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_S); - CmSdk.EnableLedControl(false); - Thread.Sleep(500); - } - - public override bool CanEnable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_S); - - // Doesn't seem reliable but better than nothing I suppose - return CmSdk.IsDevicePlug(); - } - - public override void Enable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_S); - CmSdk.EnableLedControl(true); - } - - public override void DrawBitmap(Bitmap bitmap) - { - // Resize the bitmap - using (var b = ImageUtilities.ResizeImage(bitmap, Width, Height)) - { - // Create an empty matrix - var matrix = new COLOR_MATRIX {KeyColor = new KEY_COLOR[6, 22]}; - - // Map the bytes to the matix - for (var x = 0; x < Width; x++) - { - for (var y = 0; y < Height; y++) - { - var c = b.GetPixel(x, y); - matrix.KeyColor[y, x] = new KEY_COLOR(c.R, c.G, c.B); - } - } - - // Send the matrix to the keyboard - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MKeys_S); - CmSdk.SetAllLedColor(matrix); - } - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - switch (_generalSettings.Layout) - { - case "Qwerty": - return KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - case "Qwertz": - return KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - default: - return KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - } - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProL.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProL.cs deleted file mode 100644 index 057439fb9..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProL.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Drawing; -using Artemis.DeviceProviders.CoolerMaster.Utilities; -using Ninject.Extensions.Logging; - -namespace Artemis.DeviceProviders.CoolerMaster -{ - public class MastermouseProL : DeviceProvider - { - public MastermouseProL(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mouse; - } - - public ILogger Logger { get; } - - public override void UpdateDevice(Bitmap bitmap) - { - // Create an empty matrix - var matrix = new COLOR_MATRIX { KeyColor = new KEY_COLOR[6, 22] }; - - // Get colors from the bitmap's center X and on 2/5th, 3/5th and 4/5th Y - var x = bitmap.Width / 2; - var y = bitmap.Width / 5; - var led1Color = bitmap.GetPixel(x, y); - var led2Color = bitmap.GetPixel(x, y * 2); - var led3Color = bitmap.GetPixel(x, y * 3); - var led4Color = bitmap.GetPixel(x, y * 4); - matrix.KeyColor[0, 0] = new KEY_COLOR(led1Color.R, led1Color.G, led1Color.B); - matrix.KeyColor[0, 1] = new KEY_COLOR(led2Color.R, led2Color.G, led2Color.B); - matrix.KeyColor[0, 2] = new KEY_COLOR(led3Color.R, led3Color.G, led3Color.B); - matrix.KeyColor[0, 3] = new KEY_COLOR(led4Color.R, led4Color.G, led4Color.B); - - // Send the matrix to the mouse - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MMouse_L); - CmSdk.SetAllLedColor(matrix); - } - - public override bool TryEnable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MMouse_L); - - // Doesn't seem reliable but better than nothing I suppose - try - { - CanUse = CmSdk.IsDevicePlug(); - if (CanUse) - CmSdk.EnableLedControl(true); - } - catch (Exception) - { - CanUse = false; - } - - Logger.Debug("Attempted to enable Mastermouse Pro L. CanUse: {0}", CanUse); - return CanUse; - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProS.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProS.cs deleted file mode 100644 index ebb07185c..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/MastermouseProS.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Drawing; -using Artemis.DeviceProviders.CoolerMaster.Utilities; -using Ninject.Extensions.Logging; - -namespace Artemis.DeviceProviders.CoolerMaster -{ - public class MastermouseProS : DeviceProvider - { - public MastermouseProS(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mouse; - } - - public ILogger Logger { get; } - - public override void UpdateDevice(Bitmap bitmap) - { - // Create an empty matrix - var matrix = new COLOR_MATRIX {KeyColor = new KEY_COLOR[6, 22]}; - - // Get colors from the bitmap's center X and on 1/3rd and 2/3rd Y - var x = bitmap.Width / 2; - var y = bitmap.Width / 3; - var led1Color = bitmap.GetPixel(x, y); - var led2Color = bitmap.GetPixel(x, y * 2); - matrix.KeyColor[0, 0] = new KEY_COLOR(led1Color.R, led1Color.G, led1Color.B); - matrix.KeyColor[0, 1] = new KEY_COLOR(led2Color.R, led2Color.G, led2Color.B); - - // Send the matrix to the mouse - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MMouse_S); - CmSdk.SetAllLedColor(matrix); - } - - public override bool TryEnable() - { - CmSdk.SetControlDevice(DEVICE_INDEX.DEV_MMouse_S); - - // Doesn't seem reliable but better than nothing I suppose - try - { - CanUse = CmSdk.IsDevicePlug(); - if (CanUse) - CmSdk.EnableLedControl(true); - } - catch (Exception) - { - CanUse = false; - } - - Logger.Debug("Attempted to enable Mastermouse Pro S. CanUse: {0}", CanUse); - return CanUse; - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/CoolerMaster/Utilities/CMSDK.cs b/Artemis/Artemis/DeviceProviders/CoolerMaster/Utilities/CMSDK.cs deleted file mode 100644 index f9ffc25fa..000000000 --- a/Artemis/Artemis/DeviceProviders/CoolerMaster/Utilities/CMSDK.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Artemis.DeviceProviders.CoolerMaster.Utilities -{ - public struct KEY_COLOR - { - public byte r; - public byte g; - public byte b; - - public KEY_COLOR(byte colR, byte colG, byte colB) - { - r = colR; - g = colG; - b = colB; - } - } - - public struct COLOR_MATRIX - { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 132)] public KEY_COLOR[,] KeyColor; - } - - //Enumeration of device list - public enum DEVICE_INDEX - { - DEV_MKeys_L = 0, - DEV_MKeys_S = 1, - DEV_MKeys_L_White = 2, - DEV_MKeys_M_White = 3, - DEV_MMouse_L = 4, - DEV_MMouse_S = 5, - DEV_MKeys_M = 6, - DEV_MKeys_S_White = 7 - } - - //Enumeration of device layout - public enum LAYOUT_KEYBOARD - { - LAYOUT_UNINIT = 0, - LAYOUT_US = 1, - LAYOUT_EU = 2 - } - - public static class CmSdk - { - /// - /// Sets the control device which all following actions are targetted to - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - public static extern void SetControlDevice(DEVICE_INDEX devIndex); - - /// - /// Obtain current device layout - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern LAYOUT_KEYBOARD GetDeviceLayout(); - - /// - /// Verify if the currently conrolled device is plugged in - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool IsDevicePlug(); - - /// - /// Enables led control on the currently controlled device - /// - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool EnableLedControl(bool bEnable); - - /// - /// Sets the LED of the currently controlled device - /// - /// - /// - /// - /// - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SetLedColor(int iRow, int iColumn, byte r, byte g, byte b); - - /// - /// Sets all LEDS using the given color matrix - /// - /// - /// - [DllImport("lib\\SDKDLL ", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - public static extern bool SetAllLedColor(COLOR_MATRIX colorMatrix); - } -} diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadset.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadset.cs deleted file mode 100644 index 138f7957f..000000000 --- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairHeadset.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Drawing; -using System.Threading; -using Artemis.DeviceProviders.Corsair.Utilities; -using CUE.NET; -using CUE.NET.Brushes; -using CUE.NET.Devices.Generic.Enums; -using Ninject.Extensions.Logging; - -namespace Artemis.DeviceProviders.Corsair -{ - public class CorsairHeadset : DeviceProvider - { - private readonly ImageBrush _headsetBrush; - - public CorsairHeadset(ILogger logger) - { - Logger = logger; - Type = DeviceType.Headset; - _headsetBrush = new ImageBrush(); - } - - public ILogger Logger { get; set; } - - public override bool TryEnable() - { - try - { - lock (CorsairUtilities.SDKLock) - { - CanUse = CanInitializeSdk(); - if (CanUse && !CueSDK.IsInitialized) - CueSDK.Initialize(true); - } - - } - catch (Exception) - { - CanUse = false; - } - - Logger.Debug("Attempted to enable Corsair headset. CanUse: {0}", CanUse); - - if (CanUse) - { - CueSDK.UpdateMode = UpdateMode.Manual; - CueSDK.HeadsetSDK.Brush = _headsetBrush; - } - - return CanUse; - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - - public override void UpdateDevice(Bitmap bitmap) - { - if (!CanUse || bitmap == null) - return; - if (bitmap.Width != bitmap.Height) - throw new ArgumentException("Bitmap must be a perfect square"); - - _headsetBrush.Image = bitmap; - CueSDK.HeadsetSDK.Update(); - } - - private static bool CanInitializeSdk() - { - // This will skip the check-loop if the SDK is initialized - if (CueSDK.IsInitialized) - return CueSDK.IsSDKAvailable(CorsairDeviceType.Headset); - - for (var tries = 0; tries < 9; tries++) - { - if (CueSDK.IsSDKAvailable(CorsairDeviceType.Headset)) - return true; - Thread.Sleep(2000); - } - return false; - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs deleted file mode 100644 index 92af0fab2..000000000 --- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairKeyboard.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Drawing; -using System.Linq; -using System.Windows; -using System.Windows.Forms; -using Artemis.DeviceProviders.Corsair.Utilities; -using Artemis.Properties; -using Artemis.Utilities; -using CUE.NET; -using CUE.NET.Brushes; -using CUE.NET.Devices.Generic; -using CUE.NET.Devices.Generic.Enums; -using CUE.NET.Exceptions; -using CUE.NET.Helper; -using Ninject.Extensions.Logging; -using Point = System.Drawing.Point; - -namespace Artemis.DeviceProviders.Corsair -{ - public class CorsairKeyboard : KeyboardProvider - { - private CUE.NET.Devices.Keyboard.CorsairKeyboard _keyboard; - private ImageBrush _keyboardBrush; - - public CorsairKeyboard(ILogger logger) - { - Logger = logger; - Name = "Corsair RGB Keyboard"; - CantEnableText = "Couldn't connect to your Corsair keyboard.\n" + - "Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n" + - "In CUE, make sure \"Enable SDK\" is checked under Global Settings.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - } - - public ILogger Logger { get; set; } - - public override bool CanEnable() - { - return CueSDK.IsSDKAvailable(CorsairDeviceType.Keyboard); - } - - /// - /// Enables the SDK and sets updatemode to manual as well as the color of the background to black. - /// - public override void Enable() - { - lock (CorsairUtilities.SDKLock) - { - if (!CueSDK.IsInitialized) - CueSDK.Initialize(true); - } - - CueSDK.UpdateMode = UpdateMode.Manual; - _keyboard = CueSDK.KeyboardSDK; - switch (_keyboard.DeviceInfo.Model) - { - case "K95 RGB": - Height = 7; - Width = 25; - Slug = "corsair-k95-rgb"; - PreviewSettings = new PreviewSettings(new Rect(20, 26, 1066, 282), Resources.k95); - break; - case "K95 RGB PLATINUM": - Height = 9; - Width = 22; - Slug = "corsair-k95-rgb-platinum"; - PreviewSettings = new PreviewSettings(new Rect(12, 1, 1075, 346), Resources.k95_platinum); - break; - case "K70 RGB": - case "K70 RGB RAPIDFIRE": - case "K70 LUX RGB": - Height = 7; - Width = 21; - Slug = "corsair-k70-rgb"; - PreviewSettings = new PreviewSettings(new Rect(15, 26, 929, 282), Resources.k70); - break; - case "K65 RGB": - case "CGK65 RGB": - case "K65 LUX RGB": - case "K65 RGB RAPIDFIRE": - Height = 7; - Width = 18; - Slug = "corsair-k65-rgb"; - PreviewSettings = new PreviewSettings(new Rect(15, 30, 751, 284), Resources.k65); - break; - case "STRAFE RGB": - Height = 8; - Width = 22; - Slug = "corsair-strafe-rgb"; - PreviewSettings = new PreviewSettings(new Rect(23, 12, 937, 324), Resources.strafe); - break; - } - - Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model); - - _keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush()); - } - - public override void Disable() - { - try - { - CueSDK.Reset(); - } - catch (WrapperException e) - { - // This occurs when releasing the SDK after sleep, ignore it - if (e.Message != "The previously loaded Keyboard got disconnected.") - throw; - } - } - - /// - /// Properly resizes any size bitmap to the keyboard by creating a rectangle whose size is dependent on the bitmap - /// size. - /// - /// - public override void DrawBitmap(Bitmap bitmap) - { - _keyboardBrush.Image = bitmap; - _keyboard.Update(); - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - var widthMultiplier = Width / _keyboard.Brush.RenderedRectangle.Width; - var heightMultiplier = Height / _keyboard.Brush.RenderedRectangle.Height; - - CorsairLed cueLed = null; - try - { - cueLed = _keyboard.Leds.FirstOrDefault(k => k.Id.ToString() == keyCode.ToString()) ?? - _keyboard.Leds.FirstOrDefault(k => k.Id == CorsairUtilities.FormsKeys[keyCode]); - - Logger.Trace("Keycode: {0} resolved to CUE LED: {1}", keyCode, cueLed); - } - catch (Exception) - { - // ignored - } - - if (cueLed == null) - return null; - - var center = cueLed.LedRectangle.GetCenter(); - return new KeyMatch(keyCode, (int) (center.X * widthMultiplier), (int) (center.Y * heightMultiplier)); - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairMouse.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairMouse.cs deleted file mode 100644 index 31a0249b5..000000000 --- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairMouse.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Drawing; -using System.Threading; -using Artemis.DeviceProviders.Corsair.Utilities; -using CUE.NET; -using CUE.NET.Brushes; -using CUE.NET.Devices.Generic.Enums; -using Ninject.Extensions.Logging; - -namespace Artemis.DeviceProviders.Corsair -{ - public class CorsairMouse : DeviceProvider - { - private readonly ImageBrush _mouseBrush; - - public CorsairMouse(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mouse; - _mouseBrush = new ImageBrush(); - } - - public ILogger Logger { get; set; } - - public override bool TryEnable() - { - try - { - lock (CorsairUtilities.SDKLock) - { - CanUse = CanInitializeSdk(); - if (CanUse && !CueSDK.IsInitialized) - CueSDK.Initialize(true); - } - } - catch (Exception) - { - CanUse = false; - } - - Logger.Debug("Attempted to enable Corsair mice. CanUse: {0}", CanUse); - - if (CanUse) - { - CueSDK.UpdateMode = UpdateMode.Manual; - CueSDK.MouseSDK.Brush = _mouseBrush; - } - - return CanUse; - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - - public override void UpdateDevice(Bitmap bitmap) - { - if (!CanUse || bitmap == null) - return; - if (bitmap.Width != bitmap.Height) - throw new ArgumentException("Bitmap must be a perfect square"); - - _mouseBrush.Image = bitmap; - CueSDK.MouseSDK.Update(); - } - - private static bool CanInitializeSdk() - { - // This will skip the check-loop if the SDK is initialized - if (CueSDK.IsInitialized) - return CueSDK.IsSDKAvailable(CorsairDeviceType.Mouse); - - for (var tries = 0; tries < 9; tries++) - { - if (CueSDK.IsSDKAvailable(CorsairDeviceType.Mouse)) - return true; - Thread.Sleep(2000); - } - return false; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Corsair/CorsairMousemat.cs b/Artemis/Artemis/DeviceProviders/Corsair/CorsairMousemat.cs deleted file mode 100644 index b08435c0d..000000000 --- a/Artemis/Artemis/DeviceProviders/Corsair/CorsairMousemat.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Drawing; -using System.Threading; -using Artemis.DeviceProviders.Corsair.Utilities; -using CUE.NET; -using CUE.NET.Brushes; -using CUE.NET.Devices.Generic.Enums; -using Ninject.Extensions.Logging; - -namespace Artemis.DeviceProviders.Corsair -{ - public class CorsairMousemat : DeviceProvider - { - private readonly ImageBrush _mousematBrush; - - public CorsairMousemat(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mousemat; - _mousematBrush = new ImageBrush(); - } - - public ILogger Logger { get; set; } - - public override bool TryEnable() - { - try - { - lock (CorsairUtilities.SDKLock) - { - CanUse = CanInitializeSdk(); - if (CanUse && !CueSDK.IsInitialized) - CueSDK.Initialize(true); - } - } - catch (Exception) - { - CanUse = false; - } - - Logger.Debug("Attempted to enable Corsair mousemat. CanUse: {0}", CanUse); - - if (CanUse) - { - CueSDK.UpdateMode = UpdateMode.Manual; - CueSDK.MousematSDK.Brush = _mousematBrush; - } - - return CanUse; - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - - public override void UpdateDevice(Bitmap bitmap) - { - if (!CanUse || bitmap == null) - return; - if (bitmap.Width != bitmap.Height) - throw new ArgumentException("Bitmap must be a perfect square"); - - _mousematBrush.Image = bitmap; - CueSDK.MousematSDK.Update(); - } - - private static bool CanInitializeSdk() - { - // This will skip the check-loop if the SDK is initialized - if (CueSDK.IsInitialized) - return CueSDK.IsSDKAvailable(CorsairDeviceType.Mousemat); - - for (var tries = 0; tries < 9; tries++) - { - if (CueSDK.IsSDKAvailable(CorsairDeviceType.Mousemat)) - return true; - Thread.Sleep(2000); - } - return false; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Corsair/Utilities/CorsairUtilities.cs b/Artemis/Artemis/DeviceProviders/Corsair/Utilities/CorsairUtilities.cs deleted file mode 100644 index 27eead69a..000000000 --- a/Artemis/Artemis/DeviceProviders/Corsair/Utilities/CorsairUtilities.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Forms; -using CUE.NET.Devices.Generic.Enums; - -namespace Artemis.DeviceProviders.Corsair.Utilities -{ - public static class CorsairUtilities - { - static CorsairUtilities() - { - FormsKeys = new Dictionary - { - {Keys.Scroll, CorsairLedId.ScrollLock}, - {Keys.Pause, CorsairLedId.PauseBreak}, - {Keys.Back, CorsairLedId.Backspace}, - {Keys.Oemtilde, CorsairLedId.GraveAccentAndTilde}, - {Keys.OemMinus, CorsairLedId.MinusAndUnderscore}, - {Keys.Oemplus, CorsairLedId.EqualsAndPlus}, - {Keys.OemOpenBrackets, CorsairLedId.BracketLeft}, - {Keys.Oem6, CorsairLedId.BracketRight}, - {Keys.Return, CorsairLedId.Enter}, - {Keys.Next, CorsairLedId.PageDown}, - {Keys.Capital, CorsairLedId.CapsLock}, - {Keys.Oem1, CorsairLedId.SemicolonAndColon}, - {Keys.Oem7, CorsairLedId.ApostropheAndDoubleQuote}, - {Keys.OemBackslash, CorsairLedId.NonUsBackslash}, - {Keys.LShiftKey, CorsairLedId.LeftShift}, - {Keys.Oem5, CorsairLedId.NonUsTilde}, - {Keys.Oemcomma, CorsairLedId.CommaAndLessThan}, - {Keys.OemPeriod, CorsairLedId.PeriodAndBiggerThan}, - {Keys.OemQuestion, CorsairLedId.SlashAndQuestionMark}, - {Keys.RShiftKey, CorsairLedId.RightShift}, - {Keys.LControlKey, CorsairLedId.LeftCtrl}, - {Keys.LWin, CorsairLedId.LeftGui}, - {Keys.LMenu, CorsairLedId.LeftAlt}, - {Keys.RMenu, CorsairLedId.RightAlt}, - {Keys.RWin, CorsairLedId.RightGui}, - {Keys.Apps, CorsairLedId.Application}, - {Keys.RControlKey, CorsairLedId.RightCtrl}, - {Keys.Left, CorsairLedId.LeftArrow}, - {Keys.Down, CorsairLedId.DownArrow}, - {Keys.Right, CorsairLedId.RightArrow}, - {Keys.Up, CorsairLedId.UpArrow}, - {Keys.NumPad0, CorsairLedId.Keypad0}, - {Keys.NumPad1, CorsairLedId.Keypad1}, - {Keys.NumPad2, CorsairLedId.Keypad2}, - {Keys.NumPad3, CorsairLedId.Keypad3}, - {Keys.NumPad4, CorsairLedId.Keypad4}, - {Keys.NumPad5, CorsairLedId.Keypad5}, - {Keys.NumPad6, CorsairLedId.Keypad6}, - {Keys.NumPad7, CorsairLedId.Keypad7}, - {Keys.NumPad8, CorsairLedId.Keypad8}, - {Keys.NumPad9, CorsairLedId.Keypad9}, - {Keys.Divide, CorsairLedId.KeypadSlash}, - {Keys.Multiply, CorsairLedId.KeypadAsterisk}, - {Keys.Subtract, CorsairLedId.KeypadMinus}, - {Keys.Add, CorsairLedId.KeypadPlus}, - {Keys.Decimal, CorsairLedId.KeypadPeriodAndDelete}, - {Keys.MediaStop, CorsairLedId.Stop}, - {Keys.MediaPreviousTrack, CorsairLedId.ScanPreviousTrack}, - {Keys.MediaNextTrack, CorsairLedId.ScanNextTrack}, - {Keys.MediaPlayPause, CorsairLedId.PlayPause}, - {Keys.VolumeMute, CorsairLedId.Mute}, - {Keys.VolumeUp, CorsairLedId.VolumeUp}, - {Keys.VolumeDown, CorsairLedId.VolumeDown} - }; - } - - public static Dictionary FormsKeys { get; set; } - public static object SDKLock { get; set; } = new object(); - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/DeviceProvider.cs b/Artemis/Artemis/DeviceProviders/DeviceProvider.cs deleted file mode 100644 index 9399328e0..000000000 --- a/Artemis/Artemis/DeviceProviders/DeviceProvider.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Drawing; -using System.Threading.Tasks; - -namespace Artemis.DeviceProviders -{ - public abstract class DeviceProvider - { - /// - /// Indicates the device type - /// - public DeviceType Type { get; set; } - - /// - /// Indicates whether or not the device can be updated - /// - public bool CanUse { get; set; } - - /// - /// Updates a non-keyboard to take the colours found in the provided bitmap - /// - /// - public abstract void UpdateDevice(Bitmap bitmap); - - /// - /// Tries to enable the device and updates CanUse accordingly - /// - public abstract bool TryEnable(); - - /// - /// Disables the device - /// - public abstract void Disable(); - - /// - /// Tries to enable the device and updates CanUse accordingly asynchronously - /// - /// - public Task TryEnableAsync() - { - return Task.Run(() => TryEnable()); - } - } - - public enum DeviceType - { - Keyboard, - Mouse, - Headset, - Generic, - Mousemat - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/KeyboardProvider.cs b/Artemis/Artemis/DeviceProviders/KeyboardProvider.cs deleted file mode 100644 index c2d767bca..000000000 --- a/Artemis/Artemis/DeviceProviders/KeyboardProvider.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Drawing; -using System.Threading; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Forms; -using System.Windows.Media.Imaging; -using Artemis.Utilities; -using MahApps.Metro.Controls.Dialogs; -using Size = System.Windows.Size; - -namespace Artemis.DeviceProviders -{ - public abstract class KeyboardProvider : DeviceProvider - { - protected KeyboardProvider() - { - Type = DeviceType.Keyboard; - } - - public string Name { get; set; } - public string Slug { get; set; } - public int Height { get; set; } - public int Width { get; set; } - public string CantEnableText { get; set; } - public PreviewSettings PreviewSettings { get; set; } - - public abstract bool CanEnable(); - public abstract void Enable(); - public abstract void DrawBitmap(Bitmap bitmap); - - /// - /// Returns a bitmap matching the keyboard's dimensions using the provided scale - /// - /// - public Bitmap KeyboardBitmap(int scale = 4) => new Bitmap(Width * scale, Height * scale); - - public Rect KeyboardRectangle(int scale = 4) => new Rect(new Size(Width * scale, Height * scale)); - - /// - /// Runs CanEnable asynchronously multiple times until successful, cancelled or max tries reached - /// - /// - /// - public Task CanEnableAsync(ProgressDialogController dialog) - { - return Task.Run(() => - { - for (var tries = 1; tries <= 10; tries++) - { - // Dialog interaction - if (dialog != null) - { - // Stop if cancelled by user - if (dialog.IsCanceled) - { - dialog.SetIndeterminate(); - return false; - } - // Updated progress to indicate how much tries are left - dialog.SetProgress(0.1 * tries); - } - - if (CanEnable()) - { - dialog?.SetIndeterminate(); - return true; - } - Thread.Sleep(2000); - } - dialog?.SetIndeterminate(); - return false; - }); - } - - /// - /// Runs CanEnable asynchronously - /// - /// - /// - public Task EnableAsync(ProgressDialogController dialog) - { - return Task.Run(() => Enable()); - } - - public override void UpdateDevice(Bitmap bitmap) - { - throw new NotSupportedException("KeyboardProvider doesn't implement UpdateDevice, use DrawBitmap instead."); - } - - public override bool TryEnable() - { - throw new NotSupportedException("KeyboardProvider doesn't implement TryEnable, use CanEnableAsync instead."); - } - - /// - /// Returns the real life X and Y coordinates of the given key - /// - /// - /// - public abstract KeyMatch? GetKeyPosition(Keys keyCode); - } - - public struct KeyMatch - { - public KeyMatch(Keys keyCode, int x, int y) - { - KeyCode = keyCode; - X = x; - Y = y; - } - - public Keys KeyCode { get; set; } - public int X { get; set; } - public int Y { get; set; } - } - - public struct PreviewSettings - { - public Rect OverlayRectangle { get; set; } - public Rect BackgroundRectangle { get; set; } - public BitmapImage Image { get; set; } - - public PreviewSettings(Rect overlayRectangle, Bitmap bitmap) - { - OverlayRectangle = overlayRectangle; - BackgroundRectangle = new Rect(0, 0, bitmap.Width, bitmap.Height); - Image = ImageUtilities.BitmapToBitmapImage(bitmap); - Image.Freeze(); - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Logitech/G810.cs b/Artemis/Artemis/DeviceProviders/Logitech/G810.cs deleted file mode 100644 index d6d7538c8..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/G810.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System.Drawing; -using System.Linq; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Properties; -using Artemis.Settings; - -namespace Artemis.DeviceProviders.Logitech -{ - public class G810 : LogitechKeyboard - { - private GeneralSettings _generalSettings; - - public G810() - { - Name = "Logitech G810 RGB"; - Slug = "logitech-g810"; - CantEnableText = "Couldn't connect to your Logitech G810.\n" + - "Please check your cables and updating the Logitech Gaming Software\n" + - "A minimum version of 8.81.15 is required.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - Height = 7; - Width = 21; - PreviewSettings = new PreviewSettings(new Rect(19, 36, 1010, 304), Resources.g810); - _generalSettings = SettingsProvider.Load(); - } - - /// - /// The G910 also updates the G-logo, G-badge and G-keys - /// - /// - public override void DrawBitmap(Bitmap bitmap) - { - using (var croppedBitmap = new Bitmap(21 * 4, 6 * 4)) - { - // Deal with non-standard DPI - croppedBitmap.SetResolution(96, 96); - // Don't forget that the image is upscaled 4 times - using (var g = Graphics.FromImage(croppedBitmap)) - { - g.DrawImage(bitmap, new Rectangle(0, 0, 84, 24), new Rectangle(4, 4, 84, 24), GraphicsUnit.Pixel); - } - - LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB); - // TODO: Remapping - LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap)); - } - - using (var resized = OrionUtilities.ResizeImage(bitmap, 21, 7)) - { - // Color G-logo, lets also try some other values to see what happens - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_LOGO, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_BADGE, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_1, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_2, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_3, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_4, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_5, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_6, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_7, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_8, 0, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_9, 0, 0); - } - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - KeyMatch value; - switch (_generalSettings.Layout) - { - case "Qwerty": - value = KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - case "Qwertz": - value = KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - default: - value = KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - } - - // Adjust the distance by 1 on y for the G810 - return new KeyMatch(value.KeyCode, value.X, value.Y + 1); - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Logitech/G910.cs b/Artemis/Artemis/DeviceProviders/Logitech/G910.cs deleted file mode 100644 index 295c5be3c..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/G910.cs +++ /dev/null @@ -1,235 +0,0 @@ -using System; -using System.Drawing; -using System.Linq; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Properties; -using Artemis.Settings; - -namespace Artemis.DeviceProviders.Logitech -{ - public class G910 : LogitechKeyboard - { - private readonly GeneralSettings _generalSettings; - - public G910() - { - Name = "Logitech G910 RGB"; - Slug = "logitech-g910"; - CantEnableText = "Couldn't connect to your Logitech G910.\n" + - "Please check your cables and updating the Logitech Gaming Software\n" + - "A minimum version of 8.81.15 is required.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - Height = 7; - Width = 22; - PreviewSettings = new PreviewSettings(new Rect(34, 18, 916, 272), Resources.g910); - _generalSettings = SettingsProvider.Load(); - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - KeyMatch value; - switch (_generalSettings.Layout) - { - case "Qwerty": - value = KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - case "Qwertz": - value = KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - default: - value = KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - break; - } - - // Adjust the distance by 1 on both x and y for the G910 - return new KeyMatch(value.KeyCode, value.X + 1, value.Y + 1); - } - - /// - /// The G910 also updates the G-logo, G-badge and G-keys - /// - /// - public override void DrawBitmap(Bitmap bitmap) - { - using (var croppedBitmap = new Bitmap(21 * 4, 6 * 4)) - { - // Deal with non-standard DPI - croppedBitmap.SetResolution(96, 96); - // Don't forget that the image is upscaled 4 times - using (var g = Graphics.FromImage(croppedBitmap)) - { - g.DrawImage(bitmap, new Rectangle(0, 0, 84, 24), new Rectangle(4, 4, 84, 24), GraphicsUnit.Pixel); - } - - LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB); - LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap, G910Keymappings)); - } - - using (var resized = OrionUtilities.ResizeImage(bitmap, 22, 7)) - { - // Color the extra keys on the left side of the keyboard - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_LOGO, 0, 1); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_1, 0, 2); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_2, 0, 3); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_3, 0, 4); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_4, 0, 5); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_5, 0, 6); - - // Color the extra keys on the top of the keyboard - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_6, 3, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_7, 4, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_8, 5, 0); - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_9, 6, 0); - - // Color the G-badge - SetLogitechColorFromCoordinates(resized, KeyboardNames.G_BADGE, 5, 6); - } - } - - // These mappings are used by the G910 to fix alignments - public static OrionUtilities.KeyMapping[] G910Keymappings = - { - // First row - new OrionUtilities.KeyMapping(0, 0), - new OrionUtilities.KeyMapping(1, 1), - new OrionUtilities.KeyMapping(2, 1), - new OrionUtilities.KeyMapping(3, 2), - new OrionUtilities.KeyMapping(4, 3), - new OrionUtilities.KeyMapping(5, 4), - new OrionUtilities.KeyMapping(6, 5), - new OrionUtilities.KeyMapping(7, 6), - new OrionUtilities.KeyMapping(8, 7), - new OrionUtilities.KeyMapping(9, 8), - new OrionUtilities.KeyMapping(10, 9), - new OrionUtilities.KeyMapping(11, 9), - new OrionUtilities.KeyMapping(12, 10), - new OrionUtilities.KeyMapping(13, 11), - new OrionUtilities.KeyMapping(13, 12), - new OrionUtilities.KeyMapping(14, 13), - new OrionUtilities.KeyMapping(15, 14), - new OrionUtilities.KeyMapping(16, 15), - new OrionUtilities.KeyMapping(17, 16), - new OrionUtilities.KeyMapping(18, 17), - new OrionUtilities.KeyMapping(19, 18), - - // Second row - new OrionUtilities.KeyMapping(21, 21), - new OrionUtilities.KeyMapping(22, 22), - new OrionUtilities.KeyMapping(23, 23), - new OrionUtilities.KeyMapping(24, 24), - new OrionUtilities.KeyMapping(25, 25), - new OrionUtilities.KeyMapping(26, 26), - new OrionUtilities.KeyMapping(27, 27), - new OrionUtilities.KeyMapping(28, 28), - new OrionUtilities.KeyMapping(29, 29), - new OrionUtilities.KeyMapping(30, 30), - new OrionUtilities.KeyMapping(31, 31), - new OrionUtilities.KeyMapping(32, 32), - new OrionUtilities.KeyMapping(33, 33), - new OrionUtilities.KeyMapping(34, 34), - new OrionUtilities.KeyMapping(35, 35), - new OrionUtilities.KeyMapping(36, 36), - new OrionUtilities.KeyMapping(37, 37), - new OrionUtilities.KeyMapping(38, 38), - new OrionUtilities.KeyMapping(39, 39), - new OrionUtilities.KeyMapping(40, 40), - new OrionUtilities.KeyMapping(41, 41), - - // Third row - new OrionUtilities.KeyMapping(42, 42), - new OrionUtilities.KeyMapping(43, 43), - new OrionUtilities.KeyMapping(44, 44), - new OrionUtilities.KeyMapping(45, 45), - new OrionUtilities.KeyMapping(46, 46), - new OrionUtilities.KeyMapping(47, 46), - new OrionUtilities.KeyMapping(48, 47), - new OrionUtilities.KeyMapping(49, 48), - new OrionUtilities.KeyMapping(50, 49), - new OrionUtilities.KeyMapping(51, 50), - new OrionUtilities.KeyMapping(52, 51), - new OrionUtilities.KeyMapping(53, 52), - new OrionUtilities.KeyMapping(54, 53), - new OrionUtilities.KeyMapping(54, 54), - new OrionUtilities.KeyMapping(55, 55), - new OrionUtilities.KeyMapping(56, 56), - new OrionUtilities.KeyMapping(57, 57), - new OrionUtilities.KeyMapping(58, 58), - new OrionUtilities.KeyMapping(59, 59), - new OrionUtilities.KeyMapping(60, 60), - new OrionUtilities.KeyMapping(61, 61), - new OrionUtilities.KeyMapping(62, 62), - - // Fourth row - new OrionUtilities.KeyMapping(63, 63), - new OrionUtilities.KeyMapping(64, 64), - new OrionUtilities.KeyMapping(65, 65), - new OrionUtilities.KeyMapping(66, 65), - new OrionUtilities.KeyMapping(67, 66), - new OrionUtilities.KeyMapping(68, 67), - new OrionUtilities.KeyMapping(69, 68), - new OrionUtilities.KeyMapping(70, 69), - new OrionUtilities.KeyMapping(71, 70), - new OrionUtilities.KeyMapping(72, 71), - new OrionUtilities.KeyMapping(73, 72), - new OrionUtilities.KeyMapping(74, 73), - new OrionUtilities.KeyMapping(75, 74), - new OrionUtilities.KeyMapping(76, 75), - new OrionUtilities.KeyMapping(76, 76), - new OrionUtilities.KeyMapping(78, 77), - new OrionUtilities.KeyMapping(79, 78), - new OrionUtilities.KeyMapping(79, 79), - new OrionUtilities.KeyMapping(80, 80), - new OrionUtilities.KeyMapping(81, 81), - new OrionUtilities.KeyMapping(82, 82), - - // Fifth row - new OrionUtilities.KeyMapping(84, 84), - new OrionUtilities.KeyMapping(85, 85), - new OrionUtilities.KeyMapping(86, 86), - new OrionUtilities.KeyMapping(87, 87), - new OrionUtilities.KeyMapping(88, 88), - new OrionUtilities.KeyMapping(89, 89), - new OrionUtilities.KeyMapping(90, 90), - new OrionUtilities.KeyMapping(91, 91), - new OrionUtilities.KeyMapping(92, 92), - new OrionUtilities.KeyMapping(93, 93), - new OrionUtilities.KeyMapping(94, 94), - new OrionUtilities.KeyMapping(95, 95), - new OrionUtilities.KeyMapping(96, 96), - new OrionUtilities.KeyMapping(97, 97), - new OrionUtilities.KeyMapping(98, 98), - new OrionUtilities.KeyMapping(99, 99), - new OrionUtilities.KeyMapping(100, 100), - new OrionUtilities.KeyMapping(101, 101), - new OrionUtilities.KeyMapping(102, 102), - new OrionUtilities.KeyMapping(103, 103), - new OrionUtilities.KeyMapping(104, 104), - - // Sixth row - new OrionUtilities.KeyMapping(105, 105), - new OrionUtilities.KeyMapping(106, 106), - new OrionUtilities.KeyMapping(107, 107), - new OrionUtilities.KeyMapping(108, 107), - new OrionUtilities.KeyMapping(109, 109), - new OrionUtilities.KeyMapping(110, 110), - new OrionUtilities.KeyMapping(111, 110), - new OrionUtilities.KeyMapping(112, 111), - new OrionUtilities.KeyMapping(113, 112), - new OrionUtilities.KeyMapping(114, 113), - new OrionUtilities.KeyMapping(115, 114), - new OrionUtilities.KeyMapping(116, 115), - new OrionUtilities.KeyMapping(115, 116), // ALTGR - new OrionUtilities.KeyMapping(116, 117), - new OrionUtilities.KeyMapping(117, 118), - new OrionUtilities.KeyMapping(118, 119), - new OrionUtilities.KeyMapping(119, 120), - new OrionUtilities.KeyMapping(120, 121), - new OrionUtilities.KeyMapping(121, 122), - new OrionUtilities.KeyMapping(122, 123), - new OrionUtilities.KeyMapping(124, 124) - }; - } -} diff --git a/Artemis/Artemis/DeviceProviders/Logitech/LogitechGeneric.cs b/Artemis/Artemis/DeviceProviders/Logitech/LogitechGeneric.cs deleted file mode 100644 index c0fc32556..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/LogitechGeneric.cs +++ /dev/null @@ -1,55 +0,0 @@ -//using System; -//using System.Drawing; -//using Artemis.DeviceProviders.Logitech.Utilities; -//using Ninject.Extensions.Logging; -// -//namespace Artemis.DeviceProviders.Logitech -//{ -// // TODO: Handle shutdown, maybe implement Disable() afterall? -// public class LogitechGeneric : DeviceProvider -// { -// /// -// /// A generic Logitech DeviceProvider. Because the Logitech SDK currently doesn't allow specific -// /// device targeting (only very broad per-key-RGB and full RGB etc..) -// /// -// public LogitechGeneric(ILogger logger) -// { -// Logger = logger; -// Type = DeviceType.Generic; -// } -// -// public ILogger Logger { get; set; } -// -// public override void UpdateDevice(Bitmap bitmap) -// { -// if (!CanUse || bitmap == null) -// return; -// -// var col = bitmap.GetPixel(bitmap.Width/2, bitmap.Height/2); -// LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_RGB); -// LogitechGSDK.LogiLedSetLighting((int) (col.R/2.55), (int) (col.G/2.55), (int) (col.B/2.55)); -// } -// -// public override bool TryEnable() -// { -// var majorNum = 0; -// var minorNum = 0; -// var buildNum = 0; -// -// LogitechGSDK.LogiLedInit(); -// LogitechGSDK.LogiLedGetSdkVersion(ref majorNum, ref minorNum, ref buildNum); -// -// // Turn it into one long number... -// var version = int.Parse($"{majorNum}{minorNum}{buildNum}"); -// CanUse = version >= 88115; -// Logger.Debug("Attempted to enable Logitech generic device. CanUse: {0}", CanUse); -// -// return CanUse; -// } -// -// public override void Disable() -// { -// throw new NotSupportedException("Can only disable a keyboard"); -// } -// } -//} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Logitech/LogitechKeyboard.cs b/Artemis/Artemis/DeviceProviders/Logitech/LogitechKeyboard.cs deleted file mode 100644 index 72ffe9926..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/LogitechKeyboard.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Drawing; -using System.Threading; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.Utilities.DataReaders; -using Microsoft.Win32; - -namespace Artemis.DeviceProviders.Logitech -{ - public abstract class LogitechKeyboard : KeyboardProvider - { - public override bool CanEnable() - { - // Just to be sure, restore the Logitech DLL registry key - DllManager.RestoreLogitechDll(); - - int majorNum = 0, minorNum = 0, buildNum = 0; - - LogitechGSDK.LogiLedInit(); - LogitechGSDK.LogiLedGetSdkVersion(ref majorNum, ref minorNum, ref buildNum); - LogitechGSDK.LogiLedShutdown(); - - // Turn it into one long number... - var version = int.Parse($"{majorNum}{minorNum}{buildNum}"); - CantEnableText = "Couldn't connect to your Logitech keyboard.\n" + - "Please check your cables and updating the Logitech Gaming Software\n" + - $"A minimum version of 8.81.15 is required (detected {majorNum}.{minorNum}.{buildNum}).\n\n" + - "If the detected version differs from the version LGS is reporting, reinstall LGS or see the FAQ.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - - return version >= 88115; - } - - public override void Enable() - { - // Initialize the SDK - LogitechGSDK.LogiLedInit(); - Thread.Sleep(200); - - LogitechGSDK.LogiLedSaveCurrentLighting(); - LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB); - } - - public override void Disable() - { - // Shutdown the SDK - LogitechGSDK.LogiLedRestoreLighting(); - LogitechGSDK.LogiLedShutdown(); - } - - protected void SetLogitechColorFromCoordinates(Bitmap bitmap, KeyboardNames key, int x, int y) - { - var color = bitmap.GetPixel(x, y); - var rPer = (int)Math.Round(color.R / 2.55); - var gPer = (int)Math.Round(color.G / 2.55); - var bPer = (int)Math.Round(color.B / 2.55); - - LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(key, rPer, gPer, bPer); - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMap.cs b/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMap.cs deleted file mode 100644 index eb31a9669..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMap.cs +++ /dev/null @@ -1,392 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Forms; - -namespace Artemis.DeviceProviders.Logitech.Utilities -{ - public static class KeyMap - { - static KeyMap() - { - // There are several keyboard layouts - - #region Qwerty - - QwertyLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oemtilde, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemMinus, 11, 1), - new KeyMatch(Keys.Oemplus, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.Q, 1, 2), - new KeyMatch(Keys.W, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Y, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.OemOpenBrackets, 12, 2), - new KeyMatch(Keys.Oem6, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.A, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.Oem1, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.Oem5, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.Z, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.M, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemQuestion, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.LMenu, 3, 5), - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - - #region Qwertz - - QwertzLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), // returns 'None' - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oem5, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemOpenBrackets, 11, 1), - new KeyMatch(Keys.Oem6, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.Q, 1, 2), - new KeyMatch(Keys.W, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Z, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.Oem1, 12, 2), - new KeyMatch(Keys.Oemplus, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.A, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.Oemtilde, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.OemQuestion, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.Y, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.M, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemMinus, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.Menu, 3, 5), // returns 'None' - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - - #region Azerty - - AzertyLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oemtilde, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemMinus, 11, 1), - new KeyMatch(Keys.Oemplus, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.A, 1, 2), - new KeyMatch(Keys.Z, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Y, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.OemQuotes, 12, 2), - new KeyMatch(Keys.Oem6, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.Q, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.M, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.Oem5, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.W, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.OemQuestion, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemQuestion, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.LMenu, 3, 5), - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - } - - public static List QwertyLayout { get; set; } - public static List QwertzLayout { get; set; } - public static List AzertyLayout { get; set; } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMapG810.cs b/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMapG810.cs deleted file mode 100644 index 35b38389c..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyMapG810.cs +++ /dev/null @@ -1,392 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Forms; - -namespace Artemis.DeviceProviders.Logitech.Utilities -{ - public static class KeyMapG810 - { - static KeyMapG810() - { - // There are several keyboard layouts - - #region Qwerty - - QwertyLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oemtilde, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemMinus, 11, 1), - new KeyMatch(Keys.Oemplus, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.Q, 1, 2), - new KeyMatch(Keys.W, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Y, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.OemOpenBrackets, 12, 2), - new KeyMatch(Keys.Oem6, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.A, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.Oem1, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.Oem5, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.Z, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.M, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemQuestion, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.LMenu, 3, 5), - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - - #region Qwertz - - QwertzLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), // returns 'None' - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oem5, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemOpenBrackets, 11, 1), - new KeyMatch(Keys.Oem6, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.Q, 1, 2), - new KeyMatch(Keys.W, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Z, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.Oem1, 12, 2), - new KeyMatch(Keys.Oemplus, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.A, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.Oemtilde, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.OemQuestion, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.Y, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.M, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemMinus, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.Menu, 3, 5), // returns 'None' - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - - #region Azerty - - AzertyLayout = new List - { - // Row 1 - new KeyMatch(Keys.Escape, 0, 0), - new KeyMatch(Keys.F1, 2, 0), - new KeyMatch(Keys.F2, 3, 0), - new KeyMatch(Keys.F3, 4, 0), - new KeyMatch(Keys.F4, 5, 0), - new KeyMatch(Keys.F5, 6, 0), - new KeyMatch(Keys.F6, 7, 0), - new KeyMatch(Keys.F7, 8, 0), - new KeyMatch(Keys.F8, 9, 0), - new KeyMatch(Keys.F9, 11, 0), - new KeyMatch(Keys.F10, 12, 0), - new KeyMatch(Keys.F11, 13, 0), - new KeyMatch(Keys.F12, 14, 0), - new KeyMatch(Keys.PrintScreen, 15, 0), - new KeyMatch(Keys.Scroll, 16, 0), - new KeyMatch(Keys.Pause, 17, 0), - - // Row 2 - new KeyMatch(Keys.Oemtilde, 0, 1), - new KeyMatch(Keys.D1, 1, 1), - new KeyMatch(Keys.D2, 2, 1), - new KeyMatch(Keys.D3, 3, 1), - new KeyMatch(Keys.D4, 4, 1), - new KeyMatch(Keys.D5, 5, 1), - new KeyMatch(Keys.D6, 6, 1), - new KeyMatch(Keys.D7, 7, 1), - new KeyMatch(Keys.D8, 8, 1), - new KeyMatch(Keys.D9, 9, 1), - new KeyMatch(Keys.D0, 10, 1), - new KeyMatch(Keys.OemMinus, 11, 1), - new KeyMatch(Keys.Oemplus, 12, 1), - new KeyMatch(Keys.Back, 13, 1), - new KeyMatch(Keys.Insert, 14, 1), - new KeyMatch(Keys.Home, 15, 1), - new KeyMatch(Keys.PageUp, 16, 1), - new KeyMatch(Keys.NumLock, 17, 1), - new KeyMatch(Keys.Divide, 18, 1), - new KeyMatch(Keys.Multiply, 19, 1), - new KeyMatch(Keys.Subtract, 20, 1), - - // Row 3 - new KeyMatch(Keys.Tab, 0, 2), - new KeyMatch(Keys.A, 1, 2), - new KeyMatch(Keys.Z, 2, 2), - new KeyMatch(Keys.E, 3, 2), - new KeyMatch(Keys.R, 5, 2), - new KeyMatch(Keys.T, 6, 2), - new KeyMatch(Keys.Y, 7, 2), - new KeyMatch(Keys.U, 8, 2), - new KeyMatch(Keys.I, 9, 2), - new KeyMatch(Keys.O, 10, 2), - new KeyMatch(Keys.P, 11, 2), - new KeyMatch(Keys.OemQuotes, 12, 2), - new KeyMatch(Keys.Oem6, 13, 2), - new KeyMatch(Keys.Delete, 14, 2), - new KeyMatch(Keys.End, 15, 2), - new KeyMatch(Keys.Next, 16, 2), - new KeyMatch(Keys.NumPad7, 17, 2), - new KeyMatch(Keys.NumPad8, 18, 2), - new KeyMatch(Keys.NumPad9, 19, 2), - new KeyMatch(Keys.Add, 20, 2), - - // Row 4 - new KeyMatch(Keys.Capital, 0, 3), - new KeyMatch(Keys.Q, 1, 3), - new KeyMatch(Keys.S, 3, 3), - new KeyMatch(Keys.D, 4, 3), - new KeyMatch(Keys.F, 5, 3), - new KeyMatch(Keys.G, 6, 3), - new KeyMatch(Keys.H, 7, 3), - new KeyMatch(Keys.J, 8, 3), - new KeyMatch(Keys.K, 9, 3), - new KeyMatch(Keys.L, 10, 3), - new KeyMatch(Keys.M, 11, 3), - new KeyMatch(Keys.Oem7, 12, 3), - new KeyMatch(Keys.Oem5, 13, 3), - new KeyMatch(Keys.Return, 14, 3), - new KeyMatch(Keys.NumPad4, 17, 3), - new KeyMatch(Keys.NumPad5, 18, 3), - new KeyMatch(Keys.NumPad6, 19, 3), - - // Row 5 - new KeyMatch(Keys.LShiftKey, 1, 4), - new KeyMatch(Keys.OemBackslash, 2, 4), - new KeyMatch(Keys.W, 2, 4), - new KeyMatch(Keys.X, 3, 4), - new KeyMatch(Keys.C, 4, 4), - new KeyMatch(Keys.V, 5, 4), - new KeyMatch(Keys.B, 6, 4), - new KeyMatch(Keys.N, 7, 4), - new KeyMatch(Keys.OemQuestion, 8, 4), - new KeyMatch(Keys.Oemcomma, 9, 4), - new KeyMatch(Keys.OemPeriod, 10, 4), - new KeyMatch(Keys.OemQuestion, 11, 4), - new KeyMatch(Keys.RShiftKey, 13, 4), - new KeyMatch(Keys.Up, 15, 4), - new KeyMatch(Keys.NumPad1, 17, 4), - new KeyMatch(Keys.NumPad2, 18, 4), - new KeyMatch(Keys.NumPad3, 19, 4), - // Both returns return "Return" (Yes...) - // new OrionKey(System.Windows.Forms.Keys.Return, 20, 4), - - // Row 6 - new KeyMatch(Keys.LControlKey, 0, 5), - new KeyMatch(Keys.LWin, 1, 5), - new KeyMatch(Keys.LMenu, 3, 5), - new KeyMatch(Keys.Space, 6, 5), - new KeyMatch(Keys.RMenu, 11, 5), - new KeyMatch(Keys.RWin, 12, 5), - new KeyMatch(Keys.Apps, 13, 5), - new KeyMatch(Keys.RControlKey, 14, 5), - new KeyMatch(Keys.Left, 15, 5), - new KeyMatch(Keys.Down, 16, 5), - new KeyMatch(Keys.Right, 17, 5), - new KeyMatch(Keys.NumPad0, 18, 5), - new KeyMatch(Keys.Decimal, 19, 5) - }; - - #endregion - } - - public static List QwertyLayout { get; set; } - public static List QwertzLayout { get; set; } - public static List AzertyLayout { get; set; } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyboardNames.cs b/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyboardNames.cs deleted file mode 100644 index 2d8758d5f..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/KeyboardNames.cs +++ /dev/null @@ -1,121 +0,0 @@ -namespace Artemis.DeviceProviders.Logitech.Utilities -{ - public enum KeyboardNames - { - ESC = 0x01, - F1 = 0x3b, - F2 = 0x3c, - F3 = 0x3d, - F4 = 0x3e, - F5 = 0x3f, - F6 = 0x40, - F7 = 0x41, - F8 = 0x42, - F9 = 0x43, - F10 = 0x44, - F11 = 0x57, - F12 = 0x58, - PRINT_SCREEN = 0x137, - SCROLL_LOCK = 0x46, - PAUSE_BREAK = 0x45, - TILDE = 0x29, - ONE = 0x02, - TWO = 0x03, - THREE = 0x04, - FOUR = 0x05, - FIVE = 0x06, - SIX = 0x07, - SEVEN = 0x08, - EIGHT = 0x09, - NINE = 0x0A, - ZERO = 0x0B, - MINUS = 0x0C, - EQUALS = 0x0D, - BACKSPACE = 0x0E, - INSERT = 0x152, - HOME = 0x147, - PAGE_UP = 0x149, - NUM_LOCK = 0x145, - NUM_SLASH = 0x135, - NUM_ASTERISK = 0x37, - NUM_MINUS = 0x4A, - TAB = 0x0F, - Q = 0x10, - W = 0x11, - E = 0x12, - R = 0x13, - T = 0x14, - Y = 0x15, - U = 0x16, - I = 0x17, - O = 0x18, - P = 0x19, - OPEN_BRACKET = 0x1A, - CLOSE_BRACKET = 0x1B, - BACKSLASH = 0x2B, - KEYBOARD_DELETE = 0x153, - END = 0x14F, - PAGE_DOWN = 0x151, - NUM_SEVEN = 0x47, - NUM_EIGHT = 0x48, - NUM_NINE = 0x49, - NUM_PLUS = 0x4E, - CAPS_LOCK = 0x3A, - A = 0x1E, - S = 0x1F, - D = 0x20, - F = 0x21, - G = 0x22, - H = 0x23, - J = 0x24, - K = 0x25, - L = 0x26, - SEMICOLON = 0x27, - APOSTROPHE = 0x28, - ENTER = 0x1C, - NUM_FOUR = 0x4B, - NUM_FIVE = 0x4C, - NUM_SIX = 0x4D, - LEFT_SHIFT = 0x2A, - Z = 0x2C, - X = 0x2D, - C = 0x2E, - V = 0x2F, - B = 0x30, - N = 0x31, - M = 0x32, - COMMA = 0x33, - PERIOD = 0x34, - FORWARD_SLASH = 0x35, - RIGHT_SHIFT = 0x36, - ARROW_UP = 0x148, - NUM_ONE = 0x4F, - NUM_TWO = 0x50, - NUM_THREE = 0x51, - NUM_ENTER = 0x11C, - LEFT_CONTROL = 0x1D, - LEFT_WINDOWS = 0x15B, - LEFT_ALT = 0x38, - SPACE = 0x39, - RIGHT_ALT = 0x138, - RIGHT_WINDOWS = 0x15C, - APPLICATION_SELECT = 0x15D, - RIGHT_CONTROL = 0x11D, - ARROW_LEFT = 0x14B, - ARROW_DOWN = 0x150, - ARROW_RIGHT = 0x14D, - NUM_ZERO = 0x52, - NUM_PERIOD = 0x53, - G_1 = 0xFFF1, - G_2 = 0xFFF2, - G_3 = 0xFFF3, - G_4 = 0xFFF4, - G_5 = 0xFFF5, - G_6 = 0xFFF6, - G_7 = 0xFFF7, - G_8 = 0xFFF8, - G_9 = 0xFFF9, - G_LOGO = 0xFFFF1, - G_BADGE = 0xFFFF2 - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/LogitechGSDK.cs b/Artemis/Artemis/DeviceProviders/Logitech/Utilities/LogitechGSDK.cs deleted file mode 100644 index a5a81a558..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/LogitechGSDK.cs +++ /dev/null @@ -1,116 +0,0 @@ -using System.Runtime.InteropServices; -using System.Text; - -namespace Artemis.DeviceProviders.Logitech.Utilities -{ - public class LogitechGSDK - { - //LED SDK - private const int LOGI_DEVICETYPE_MONOCHROME_ORD = 0; - private const int LOGI_DEVICETYPE_RGB_ORD = 1; - private const int LOGI_DEVICETYPE_PERKEY_RGB_ORD = 2; - - public const int LOGI_DEVICETYPE_MONOCHROME = 1 << LOGI_DEVICETYPE_MONOCHROME_ORD; - public const int LOGI_DEVICETYPE_RGB = 1 << LOGI_DEVICETYPE_RGB_ORD; - public const int LOGI_DEVICETYPE_PERKEY_RGB = 1 << LOGI_DEVICETYPE_PERKEY_RGB_ORD; - public const int LOGI_LED_BITMAP_WIDTH = 21; - public const int LOGI_LED_BITMAP_HEIGHT = 6; - public const int LOGI_LED_BITMAP_BYTES_PER_KEY = 4; - - public const int LOGI_LED_BITMAP_SIZE = - LOGI_LED_BITMAP_WIDTH*LOGI_LED_BITMAP_HEIGHT*LOGI_LED_BITMAP_BYTES_PER_KEY; - - public const int LOGI_LED_DURATION_INFINITE = 0; - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedInit(); - - //Config option functions - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionNumber([MarshalAs(UnmanagedType.LPWStr)] string configPath, - ref double defaultNumber); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionBool([MarshalAs(UnmanagedType.LPWStr)] string configPath, - ref bool defaultRed); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionColor([MarshalAs(UnmanagedType.LPWStr)] string configPath, - ref int defaultRed, ref int defaultGreen, ref int defaultBlue); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetConfigOptionKeyInput([MarshalAs(UnmanagedType.LPWStr)] string configPath, - StringBuilder buffer, int bufsize); - - ///////////////////// - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetTargetDevice(int targetDevice); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedGetSdkVersion(ref int majorNum, ref int minorNum, ref int buildNum); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSaveCurrentLighting(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedRestoreLighting(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, - int milliSecondsDuration, int milliSecondsInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, - int milliSecondsDuration, int milliSecondsInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedStopEffects(); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedExcludeKeysFromBitmap(KeyboardNames[] keyList, int listCount); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingFromBitmap(byte[] bitmap); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, - int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, - int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, - int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSetLightingForKeyWithKeyName(KeyboardNames keyCode, int redPercentage, - int greenPercentage, int bluePercentage); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedSaveLightingForKey(KeyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedRestoreLightingForKey(KeyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedFlashSingleKey(KeyboardNames keyName, int redPercentage, int greenPercentage, - int bluePercentage, int msDuration, int msInterval); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedPulseSingleKey(KeyboardNames keyName, int startRedPercentage, - int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, - int finishBluePercentage, int msDuration, bool isInfinite); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern bool LogiLedStopEffectsOnKey(KeyboardNames keyName); - - [DllImport("LogitechLedEnginesWrapper ", CallingConvention = CallingConvention.Cdecl)] - public static extern void LogiLedShutdown(); - } -} \ No newline at end of file diff --git a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/OrionUtilities.cs b/Artemis/Artemis/DeviceProviders/Logitech/Utilities/OrionUtilities.cs deleted file mode 100644 index 8057695f0..000000000 --- a/Artemis/Artemis/DeviceProviders/Logitech/Utilities/OrionUtilities.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Imaging; -using System.Runtime.InteropServices; - -namespace Artemis.DeviceProviders.Logitech.Utilities -{ - public static class OrionUtilities - { - public static byte[] BitmapToByteArray(Bitmap b, KeyMapping[] keymappings = null) - { - if (b.Width > 21 || b.Height > 6) - b = ResizeImage(b, 21, 6); - - var rect = new Rectangle(0, 0, b.Width, b.Height); - var bitmapData = b.LockBits(rect, ImageLockMode.ReadWrite, b.PixelFormat); - - var depth = Image.GetPixelFormatSize(b.PixelFormat); - var step = depth / 8; - var pixels = new byte[21 * 6 * step]; - var iptr = bitmapData.Scan0; - - // Copy data from pointer to array - Marshal.Copy(iptr, pixels, 0, pixels.Length); - - if (keymappings == null) - return pixels; - - var remapped = new byte[pixels.Length]; - - // Every key is 4 bytes - for (var i = 0; i <= pixels.Length / 4; i++) - { - var firstSByte = keymappings[i].Source * 4; - var firstTByte = keymappings[i].Target * 4; - - for (var j = 0; j < 4; j++) - remapped[firstTByte + j] = pixels[firstSByte + j]; - } - - b.Dispose(); - return remapped; - } - - /// - /// Resize the image to the specified width and height. - /// - /// The image to resize. - /// The width to resize to. - /// The height to resize to. - /// The resized image. - public static Bitmap ResizeImage(Image image, int width, int height) - { - var destRect = new Rectangle(0, 0, width, height); - var destImage = new Bitmap(width, height); - - destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution); - - using (var graphics = Graphics.FromImage(destImage)) - { - graphics.CompositingMode = CompositingMode.SourceCopy; - graphics.CompositingQuality = CompositingQuality.HighQuality; - - graphics.SmoothingMode = SmoothingMode.AntiAlias; - graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; - - // TODO: Make configurable - // Prevents light bleed - graphics.InterpolationMode = InterpolationMode.NearestNeighbor; - // Soft/semi-transparent keys - //graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; - - using (var wrapMode = new ImageAttributes()) - { - wrapMode.SetWrapMode(WrapMode.TileFlipXY); - graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode); - } - } - - return destImage; - } - - public struct KeyMapping - { - public KeyMapping(int source, int target) - { - Source = source; - Target = target; - } - - public int Source { get; set; } - public int Target { get; set; } - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Razer/BlackWidow.cs b/Artemis/Artemis/DeviceProviders/Razer/BlackWidow.cs deleted file mode 100644 index e2e89924f..000000000 --- a/Artemis/Artemis/DeviceProviders/Razer/BlackWidow.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System.Drawing; -using System.Linq; -using System.Windows; -using System.Windows.Forms; -using Artemis.DAL; -using Artemis.DeviceProviders.Logitech.Utilities; -using Artemis.DeviceProviders.Razer.Utilities; -using Artemis.Properties; -using Artemis.Settings; -using Corale.Colore.Core; -using Corale.Colore.Razer; -using Constants = Corale.Colore.Razer.Keyboard.Constants; - -namespace Artemis.DeviceProviders.Razer -{ - public class BlackWidow : KeyboardProvider - { - private GeneralSettings _generalSettings; - - public BlackWidow() - { - Name = "Razer BlackWidow Chroma"; - Slug = "razer-blackwidow-chroma"; - CantEnableText = "Couldn't connect to your Razer BlackWidow Chroma.\n" + - "Please check your cables and try updating Razer Synapse.\n\n" + - "If needed, you can select a different keyboard in Artemis under settings."; - - Height = Constants.MaxRows; - Width = Constants.MaxColumns; - PreviewSettings = new PreviewSettings(new Rect(26, 56, 906, 234), Resources.blackwidow); - _generalSettings = SettingsProvider.Load(); - } - - public override bool CanEnable() - { - if (!Chroma.SdkAvailable) - return false; - - // Some people have Synapse installed, but not a Chroma keyboard, deal with this - Chroma.Instance.Initialize(); - var blackWidowFound = Chroma.Instance.Query(Devices.Blackwidow).Connected; - var blackWidowTeFound = Chroma.Instance.Query(Devices.BlackwidowTe).Connected; - Chroma.Instance.Uninitialize(); - - return blackWidowFound || blackWidowTeFound; - } - - public override void Enable() - { - Chroma.Instance.Initialize(); - } - - public override void Disable() - { - Chroma.Instance.Uninitialize(); - } - - public override void DrawBitmap(Bitmap bitmap) - { - var razerArray = RazerUtilities.BitmaptoKeyboardEffect(bitmap, Height, Width); - Chroma.Instance.Keyboard.SetCustom(razerArray); - } - - public override KeyMatch? GetKeyPosition(Keys keyCode) - { - // TODO: Needs it's own keymap or a way to get it from the Chroma SDK - switch (_generalSettings.Layout) - { - case "Qwerty": - return KeyMap.QwertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - case "Qwertz": - return KeyMap.QwertzLayout.FirstOrDefault(k => k.KeyCode == keyCode); - default: - return KeyMap.AzertyLayout.FirstOrDefault(k => k.KeyCode == keyCode); - } - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Razer/Firefly.cs b/Artemis/Artemis/DeviceProviders/Razer/Firefly.cs deleted file mode 100644 index 224783e2a..000000000 --- a/Artemis/Artemis/DeviceProviders/Razer/Firefly.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Artemis.Settings; -using Artemis.DAL; -using System; -using System.Drawing; -using Corale.Colore.Core; -using Corale.Colore.Razer; -using Ninject.Extensions.Logging; -using Artemis.DeviceProviders.Razer.Utilities; - -namespace Artemis.DeviceProviders.Razer -{ - public class Firefly : DeviceProvider - { - private GeneralSettings _generalSettings; - public ILogger Logger { get; set; } - public Firefly(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mousemat; - _generalSettings = SettingsProvider.Load(); - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - - public override bool TryEnable() - { - if (!Chroma.SdkAvailable) - return false; - - - // Some people have Synapse installed, but not a Chroma keyboard, deal with this - Chroma.Instance.Initialize(); - CanUse = Chroma.Instance.Query(Devices.Firefly).Connected; - return CanUse; - } - - public override void UpdateDevice(Bitmap bitmap) - { - if (Chroma.SdkAvailable && Chroma.Instance.Initialized) - { - var razerArray = RazerUtilities.BitmaptoMousePadEffect(bitmap); - Chroma.Instance.Mousepad.SetCustom(razerArray); - } - return; - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Razer/Mamba.cs b/Artemis/Artemis/DeviceProviders/Razer/Mamba.cs deleted file mode 100644 index f7054f682..000000000 --- a/Artemis/Artemis/DeviceProviders/Razer/Mamba.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Artemis.Settings; -using Artemis.DAL; -using System; -using System.Drawing; -using Corale.Colore.Core; -using Corale.Colore.Razer; -using Ninject.Extensions.Logging; -using Artemis.DeviceProviders.Razer.Utilities; - -namespace Artemis.DeviceProviders.Razer -{ - public class Mamba : DeviceProvider - { - private GeneralSettings _generalSettings; - public ILogger Logger { get; set; } - public Mamba(ILogger logger) - { - Logger = logger; - Type = DeviceType.Mouse; - _generalSettings = SettingsProvider.Load(); - } - - public override void Disable() - { - throw new NotSupportedException("Can only disable a keyboard"); - } - - public override bool TryEnable() - { - if (!Chroma.SdkAvailable) - return false; - - - // Some people have Synapse installed, but not a Chroma keyboard, deal with this - Chroma.Instance.Initialize(); - CanUse = Chroma.Instance.Query(Devices.Mamba).Connected || Chroma.Instance.Query(Devices.MambaTe).Connected; - return CanUse; - } - - public override void UpdateDevice(Bitmap bitmap) - { - if (Chroma.SdkAvailable && Chroma.Instance.Initialized) - { - var razerArray = RazerUtilities.BitmaptoMouseEffect(bitmap); - Chroma.Instance.Mouse.SetCustom(razerArray); - } - return; - } - } -} diff --git a/Artemis/Artemis/DeviceProviders/Razer/Utilities/RazerUtilities.cs b/Artemis/Artemis/DeviceProviders/Razer/Utilities/RazerUtilities.cs deleted file mode 100644 index 2b2265b16..000000000 --- a/Artemis/Artemis/DeviceProviders/Razer/Utilities/RazerUtilities.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System.Drawing; -using Artemis.Utilities; -using Color = Corale.Colore.Core.Color; -using Corale.Colore; - -namespace Artemis.DeviceProviders.Razer.Utilities -{ - public static class RazerUtilities - { - public static Corale.Colore.Razer.Keyboard.Effects.Custom BitmaptoKeyboardEffect(Bitmap b, int height, int width) - { - - var keyboardGrid = Corale.Colore.Razer.Keyboard.Effects.Custom.Create(); - // Resize the bitmap - using (b = ImageUtilities.ResizeImage(b, width, height)) - { - // Map the bytes to the grid - for (var x = 0; x < b.Width; x++) - { - for (var y = 0; y < b.Height; y++) - { - var c = b.GetPixel(x, y); - keyboardGrid[y, x] = new Color(c.R, c.G, c.B); - } - } - - return keyboardGrid; - } - } - - public static Corale.Colore.Razer.Mousepad.Effects.Custom BitmaptoMousePadEffect(Bitmap b) - { - var mousePadGrid = Corale.Colore.Razer.Mousepad.Effects.Custom.Create(); - int pos = 0; - using (b = ImageUtilities.ResizeImage(b, 5, 5)) - { - b.RotateFlip(RotateFlipType.RotateNoneFlipX); - for (var x = 0; x < 5; x++) - { - var c = b.GetPixel(4, x); - mousePadGrid[pos++] = new Color(c.R, c.G, c.B); - } - for (var x = 0; x < 5; x++) - { - var c = b.GetPixel(x , 4); - mousePadGrid[pos++] = new Color(c.R, c.G, c.B); - } - for (var x = 0; x < 5; x++) - { - var c = b.GetPixel(0, x); - mousePadGrid[pos++] = new Color(c.R, c.G, c.B); - } - } - - return mousePadGrid; - } - - public static Corale.Colore.Razer.Mouse.Effects.Custom BitmaptoMouseEffect(Bitmap b) - { - var mouseGrid = Corale.Colore.Razer.Mouse.Effects.Custom.Create(); - using (b = ImageUtilities.ResizeImage(b, 3, 7)) - { - var c = b.GetPixel(1, 0); - int pos = 0; - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - - for (var x = 0; x < 7; x++) - { - c = b.GetPixel(0, x); - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - } - b.RotateFlip(RotateFlipType.RotateNoneFlipX); - for (var x = 0; x < 7; x++) - { - c = b.GetPixel(2, x); - mouseGrid[pos++] = new Color(c.R, c.G, c.B); - } - - } - return mouseGrid; - } - } -} \ No newline at end of file diff --git a/Artemis/Artemis/Dialogs/MarkdownDialog.xaml b/Artemis/Artemis/Dialogs/MarkdownDialog.xaml deleted file mode 100644 index a038df3a8..000000000 --- a/Artemis/Artemis/Dialogs/MarkdownDialog.xaml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - -