forked from YukiWorkshop/libuInputPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cpp
57 lines (44 loc) · 1.26 KB
/
test.cpp
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
This file is part of libuInputPlus.
Copyright (C) 2018 YukiWorkshop
This program is free software: you can redistribute it and/or modify
it under the terms of the MIT License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include "uInput.hpp"
using namespace uInputPlus;
int main() {
uInputSetup mysetup(
{"呀"},
{EV_KEY, EV_ABS},
{BTN_LEFT, BTN_RIGHT, BTN_TOOL_FINGER, BTN_TOOL_QUINTTAP, BTN_TOUCH, BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP},
{},
{
{ABS_X, 6000, 40},
{ABS_Y, 6000, 40},
{ABS_PRESSURE, 255},
{ABS_TOOL_WIDTH, 15},
{ABS_MT_SLOT, 1},
{ABS_MT_POSITION_X, 6000, 40},
{ABS_MT_POSITION_Y, 6000, 40},
{ABS_MT_TRACKING_ID, 65535},
{ABS_MT_PRESSURE, 255}
},
{INPUT_PROP_POINTER}
);
uInput myinput(mysetup);
sleep(10);
// myinput.SendKeyPress({KEY_2, KEY_3, KEY_3, KEY_6, KEY_6, KEY_6});
// myinput.SendKeyPress({{KEY_1, 1000}, {KEY_2, 600}});
myinput.EmulateSmoothScroll(-4000);
// int i = 600;
//
// while (i--) {
//// myinput.RelativeWheel(1);
// myinput.AbsoluteWheel(1);
// //myinput.RelativeMove({10, 10});
// usleep(1000*16);
// }
}