Loading SlidePresenter/ControllerSlidePresenter.csproj +11 −1 Original line number Diff line number Diff line Loading @@ -8,13 +8,23 @@ <RootNamespace>SwitchSlidePresenter</RootNamespace> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> <DefineConstants>OS_WINDOWS</DefineConstants> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))"> <DefineConstants>OS_LINUX</DefineConstants> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))"> <DefineConstants>OS_MAC</DefineConstants> </PropertyGroup> <ItemGroup> <PackageReference Include="JoyCon.NET" Version="1.0.1" /> <PackageReference Include="WiimoteLib.NetCore" Version="1.0.0" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Win32Api\Win32Api.csproj" /> <ProjectReference Include="..\Win32Api\Win32Api.csproj" Condition="$([MSBuild]::IsOSPlatform('Windows'))"/> </ItemGroup> </Project> SlidePresenter/InputSender/LinuxInputSender.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line #if OS_LINUX namespace SwitchSlidePresenter.InputSender; public class LinuxInputSender : IInputSender { public void NextSlide() { } public void PreviousSlide() { } } #endif No newline at end of file SlidePresenter/InputSender/MacInputSender.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line #if OS_MAC namespace SwitchSlidePresenter.InputSender; public class MacInputSender : IInputSender { public void NextSlide() { } public void PreviousSlide() { } } #endif No newline at end of file SlidePresenter/InputSender/WindowsInputSender.cs +4 −2 Original line number Diff line number Diff line using System.Runtime.InteropServices; #if OS_WINDOWS using System.Runtime.InteropServices; using Win32Api; namespace SwitchSlidePresenter.InputSender; Loading Loading @@ -45,3 +46,4 @@ public class WindowsInputSender : IInputSender { Win32Api.Win32Api.SendInput((uint)inputs.Length, inputs, Marshal.SizeOf(typeof(Input))); } } #endif No newline at end of file SlidePresenter/SlideSwitcher.cs +7 −0 Original line number Diff line number Diff line Loading @@ -4,7 +4,14 @@ namespace SwitchSlidePresenter; public class SlideSwitcher : IDisposable { private readonly IGamepadReader? _reader; #if OS_WINDOWS private readonly IInputSender _inputSender = new WindowsInputSender(); #elif OS_MAC private readonly IInputSender _inputSender = new MacInputSender(); #elif OS_LINUX private readonly IInputSender _inputSender = new LinuxInputSender(); #endif public SlideSwitcher(IGamepadReader? reader) { _reader = reader; Loading Loading
SlidePresenter/ControllerSlidePresenter.csproj +11 −1 Original line number Diff line number Diff line Loading @@ -8,13 +8,23 @@ <RootNamespace>SwitchSlidePresenter</RootNamespace> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))"> <DefineConstants>OS_WINDOWS</DefineConstants> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('Linux'))"> <DefineConstants>OS_LINUX</DefineConstants> </PropertyGroup> <PropertyGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))"> <DefineConstants>OS_MAC</DefineConstants> </PropertyGroup> <ItemGroup> <PackageReference Include="JoyCon.NET" Version="1.0.1" /> <PackageReference Include="WiimoteLib.NetCore" Version="1.0.0" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Win32Api\Win32Api.csproj" /> <ProjectReference Include="..\Win32Api\Win32Api.csproj" Condition="$([MSBuild]::IsOSPlatform('Windows'))"/> </ItemGroup> </Project>
SlidePresenter/InputSender/LinuxInputSender.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line #if OS_LINUX namespace SwitchSlidePresenter.InputSender; public class LinuxInputSender : IInputSender { public void NextSlide() { } public void PreviousSlide() { } } #endif No newline at end of file
SlidePresenter/InputSender/MacInputSender.cs 0 → 100644 +13 −0 Original line number Diff line number Diff line #if OS_MAC namespace SwitchSlidePresenter.InputSender; public class MacInputSender : IInputSender { public void NextSlide() { } public void PreviousSlide() { } } #endif No newline at end of file
SlidePresenter/InputSender/WindowsInputSender.cs +4 −2 Original line number Diff line number Diff line using System.Runtime.InteropServices; #if OS_WINDOWS using System.Runtime.InteropServices; using Win32Api; namespace SwitchSlidePresenter.InputSender; Loading Loading @@ -45,3 +46,4 @@ public class WindowsInputSender : IInputSender { Win32Api.Win32Api.SendInput((uint)inputs.Length, inputs, Marshal.SizeOf(typeof(Input))); } } #endif No newline at end of file
SlidePresenter/SlideSwitcher.cs +7 −0 Original line number Diff line number Diff line Loading @@ -4,7 +4,14 @@ namespace SwitchSlidePresenter; public class SlideSwitcher : IDisposable { private readonly IGamepadReader? _reader; #if OS_WINDOWS private readonly IInputSender _inputSender = new WindowsInputSender(); #elif OS_MAC private readonly IInputSender _inputSender = new MacInputSender(); #elif OS_LINUX private readonly IInputSender _inputSender = new LinuxInputSender(); #endif public SlideSwitcher(IGamepadReader? reader) { _reader = reader; Loading