diff --git a/MouseMover.sln b/MouseMover.sln new file mode 100644 index 0000000..45aee79 --- /dev/null +++ b/MouseMover.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MouseMover", "MouseMover\MouseMover.csproj", "{4056DB55-B6DF-4522-80D5-C6C1EE295B1D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4056DB55-B6DF-4522-80D5-C6C1EE295B1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4056DB55-B6DF-4522-80D5-C6C1EE295B1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4056DB55-B6DF-4522-80D5-C6C1EE295B1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4056DB55-B6DF-4522-80D5-C6C1EE295B1D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E81ADD15-B6AE-49D2-B0A1-CA3C6AE82626} + EndGlobalSection +EndGlobal diff --git a/MouseMover/App.xaml b/MouseMover/App.xaml new file mode 100644 index 0000000..0b19d71 --- /dev/null +++ b/MouseMover/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/MouseMover/App.xaml.cs b/MouseMover/App.xaml.cs new file mode 100644 index 0000000..b2890bf --- /dev/null +++ b/MouseMover/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace NoSleepMouse +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/MouseMover/AssemblyInfo.cs b/MouseMover/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/MouseMover/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/MouseMover/MainWindow.xaml b/MouseMover/MainWindow.xaml new file mode 100644 index 0000000..1dbc18d --- /dev/null +++ b/MouseMover/MainWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/MouseMover/MainWindow.xaml.cs b/MouseMover/MainWindow.xaml.cs new file mode 100644 index 0000000..d0c2042 --- /dev/null +++ b/MouseMover/MainWindow.xaml.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace MouseMover +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private Mover _mouseMOver; + + public MainWindow() + { + InitializeComponent(); + _mouseMOver = new Mover(); + } + + private void CheckBox_Checked(object sender, RoutedEventArgs e) + { + _mouseMOver.Enable(); + } + + private void CheckBox_Unchecked(object sender, RoutedEventArgs e) + { + _mouseMOver.Disable(); + } + } +} diff --git a/MouseMover/MouseMover.csproj b/MouseMover/MouseMover.csproj new file mode 100644 index 0000000..1c47944 --- /dev/null +++ b/MouseMover/MouseMover.csproj @@ -0,0 +1,24 @@ + + + + WinExe + netcoreapp3.1 + true + mouse.ico + + + + + + + + + + + + + Always + + + + \ No newline at end of file diff --git a/MouseMover/Mover.cs b/MouseMover/Mover.cs new file mode 100644 index 0000000..9993370 --- /dev/null +++ b/MouseMover/Mover.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Timers; +using WindowsInput; + +namespace MouseMover +{ + public class Mover + { + + private Timer _timer; + + public Mover() + { + _timer = new Timer(); + _timer.Interval = 3000; + _timer.Elapsed += _timer_Elapsed; + } + + public void Enable() + { + _timer.Start(); + } + + public void Disable() + { + _timer.Stop(); + } + + private void _timer_Elapsed(object sender, ElapsedEventArgs e) + { + var inSim = new InputSimulator(); + inSim.Mouse.MoveMouseBy(0, 0); + } + } +} diff --git a/MouseMover/mouse.ico b/MouseMover/mouse.ico new file mode 100644 index 0000000..837ab36 Binary files /dev/null and b/MouseMover/mouse.ico differ diff --git a/MouseMover/mouse.png b/MouseMover/mouse.png new file mode 100644 index 0000000..c55a0a0 Binary files /dev/null and b/MouseMover/mouse.png differ