Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mentola authored and mentola committed Oct 4, 2023
1 parent 2a58a4a commit a7dd460
Show file tree
Hide file tree
Showing 27 changed files with 1,839 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Easyyyyy.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34031.279
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easyyyyy", "Easyyyyy\Easyyyyy.csproj", "{695F4CB7-BAEE-48FB-A0EC-67FEC4A8B67B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{695F4CB7-BAEE-48FB-A0EC-67FEC4A8B67B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{695F4CB7-BAEE-48FB-A0EC-67FEC4A8B67B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{695F4CB7-BAEE-48FB-A0EC-67FEC4A8B67B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{695F4CB7-BAEE-48FB-A0EC-67FEC4A8B67B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B9D5F32-8EC3-43C2-8B41-A783B9C8078B}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions Easyyyyy/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Easyyyyy/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application
x:Class="Easyyyyy.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Easyyyyy"
x:Name="Application"
Startup="Application_Startup">
<Application.Resources />
</Application>
14 changes: 14 additions & 0 deletions Easyyyyy/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Easyyyyy.Views;
using System.Windows;

namespace Easyyyyy
{
public partial class App : Application
{
private void Application_Startup(object sender, StartupEventArgs e)
{
var MainWindow = new MainWindow();
MainWindow.Show();
}
}
}
17 changes: 17 additions & 0 deletions Easyyyyy/Core/Binding.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Windows.Input;

namespace Easyyyyy.Core
{
class Binding
{
public int GetIntVirtualKey(Key key)
{
return KeyInterop.VirtualKeyFromKey(key);
}

public string GetStringVirtualKey(Key key)
{
return key.ToString();
}
}
}
60 changes: 60 additions & 0 deletions Easyyyyy/Core/Mouse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Runtime.InteropServices;
using System.Windows;

namespace Easyyyyy.Core
{
public class Mouse
{
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
private static extern void mouse_event(MouseEvent dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);

private enum MouseEvent
{
MOUSEEVENTF_LEFTDOWN = 0x02,
MOUSEEVENTF_LEFTUP = 0x04,
MOUSEEVENTF_RIGHTDOWN = 0x08,
MOUSEEVENTF_RIGHTUP = 0x10,
}

[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int X;
public int Y;

public static implicit operator Point(POINT point)
{
return new Point(point.X, point.Y);
}
}

[DllImport("user32.dll")]
public static extern bool GetCursorPos(out POINT lpPoint);

public static Point GetCursorPosition()
{
POINT lpPoint;
GetCursorPos(out lpPoint);

return lpPoint;
}

public void oneLeftClick()
{
var cursorPosition = GetCursorPosition();
mouse_event(MouseEvent.MOUSEEVENTF_LEFTDOWN, Convert.ToInt32(cursorPosition.X), Convert.ToInt32(cursorPosition.Y), 0, 0);
mouse_event(MouseEvent.MOUSEEVENTF_LEFTUP, Convert.ToInt32(cursorPosition.X), Convert.ToInt32(cursorPosition.Y), 0, 0);
}

public void doubleLeftClick()
{
for (int x = 0; x != 2; x++)
{
var cursorPosition = GetCursorPosition();
mouse_event(MouseEvent.MOUSEEVENTF_LEFTDOWN, Convert.ToInt32(cursorPosition.X), Convert.ToInt32(cursorPosition.Y), 0, 0);
mouse_event(MouseEvent.MOUSEEVENTF_LEFTUP, Convert.ToInt32(cursorPosition.X), Convert.ToInt32(cursorPosition.Y), 0, 0);
}
}
}
}
Loading

0 comments on commit a7dd460

Please sign in to comment.