-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTouchPointManager.cs
More file actions
40 lines (31 loc) · 1007 Bytes
/
TouchPointManager.cs
File metadata and controls
40 lines (31 loc) · 1007 Bytes
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
37
38
39
40
using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using SequenceClicker.API;
using SequenceClicker.TouchSim;
namespace SequenceClicker
{
public static class TouchPointManager
{
private static void TouchAtPoint(int id, Point screenPoint)
{
IntPtr targetWindow = User32API.WindowFromPoint(new User32API.POINT(screenPoint));
User32API.SetForegroundWindow(targetWindow);
TouchInput.SetTouchPoint(0, screenPoint);
TouchInput.ExecuteTouchAction(TouchInput.TouchAction.Touch);
Thread.Sleep(1);
int timer = 0;
while (timer != 30)
{
TouchInput.ExecuteTouchAction(TouchInput.TouchAction.Update);
timer++;
Thread.Sleep(1);
}
TouchInput.ExecuteTouchAction(TouchInput.TouchAction.End);
}
}
}