Skip to content

Commit

Permalink
增加右键连点
Browse files Browse the repository at this point in the history
  • Loading branch information
iamverylovely committed Jul 7, 2020
1 parent 4ab8cd2 commit 605fd9e
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 11 deletions.
15 changes: 15 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 34 additions & 10 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,33 @@
using System.Windows.Forms;

namespace MouseClickTool
{
{/// <summary>
/// 怎么简单怎么来了
/// </summary>
public partial class Form1 : Form
{
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, IntPtr dwExtraInfo);

// private const uint RightDown = 0x0008;
// private const uint RightUp = 0x0010;
private const uint RightDown = 0x0008;
private const uint RightUp = 0x0010;
private const uint LeftDown = 0x0002;
private const uint LeftUp = 0x0004;

public static void SendRightClick(uint posX, uint posY)
{
mouse_event(RightDown, posX, posY, 0, new System.IntPtr());
mouse_event(RightUp, posX, posY, 0, new System.IntPtr());
}
public static void SendLeftClick(uint posX, uint posY)
{
mouse_event(LeftDown, posX, posY, 0, new System.IntPtr());
mouse_event(LeftUp, posX, posY, 0, new System.IntPtr());
}
public Form1()
{
InitializeComponent();
this.comboBox1.SelectedIndex = 0;
}

private void is_begin_Click(object sender, EventArgs e)
Expand All @@ -54,15 +62,31 @@ private void is_begin_Click(object sender, EventArgs e)
}
});
is_begin.Text = string.Format("停止");
for (; ; )
if (this.comboBox1.SelectedIndex == 0)
{
await Task.Run(() =>
for (; ; )
{
uint x = (uint)Cursor.Position.X;
uint y = (uint)Cursor.Position.Y;
SendRightClick(x, y);
Thread.Sleep(result);
});
await Task.Run(() =>
{
uint x = (uint)Cursor.Position.X;
uint y = (uint)Cursor.Position.Y;
SendLeftClick(x, y);
Thread.Sleep(result);
});
}
}
else
{
for (; ; )
{
await Task.Run(() =>
{
uint x = (uint)Cursor.Position.X;
uint y = (uint)Cursor.Position.Y;
SendRightClick(x, y);
Thread.Sleep(result);
});
}
}
});
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# MouseClickTool
简单好用的鼠标连点器,因为玩游戏需要连点,在网上找了好多连点器,有的居然还要收费,一向穷苦的我感觉为此花钱很不值得,索性自己写了个。。。

## 界面预览
![IMG](https://iamverylovely.com/v2eximg/mouse.jpg?v=1.0.0)

## 下载 (注意:需要右键以管理员身份运行,不然可能控制不了鼠标)
[本地下载](./bin/x64/Debug/MouseClickTool.exe)

[备用下载](https://iamverylovely.com/opensource/MouseClickTool.zip)
2 changes: 1 addition & 1 deletion app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
元素。
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
Expand Down
Binary file modified bin/x64/Debug/MouseClickTool.exe
Binary file not shown.
Binary file added bin/x64/Debug/MouseClickTool.zip
Binary file not shown.

0 comments on commit 605fd9e

Please sign in to comment.