C#实现扫雷游戏中左右键同时点击

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
private MouseButtons Button;
private long Ticks;
private long TicksDelay = 100000L;

private void btn_Click(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (DateTime.Now.Ticks - Ticks < TicksDelay && Button == MouseButtons.Right)
{
//左右键"同时"(先左后右)

}
else
{
//左键

}
}
else if (e.Button == MouseButtons.Right)
{
if (DateTime.Now.Ticks - Ticks < TicksDelay && Button == MouseButtons.Left)
{
//左右键"同时"(先右后左)

}
else
{
//右键

}
}
Button = e.Button;
Ticks = DateTime.Now.Ticks;

}

C#实现扫雷游戏中左右键同时点击

https://wurang.net/csharp_minesweeper_game/

作者

Wu Rang

发布于

2010-09-02

更新于

2024-06-13

许可协议

评论