-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmouse.cpp
More file actions
46 lines (44 loc) · 1.06 KB
/
mouse.cpp
File metadata and controls
46 lines (44 loc) · 1.06 KB
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
#include "Mouse.h"
/*
## Github: [Villageslayer](https://github.com/villageslayer)
## UC: [Villageslayer](https://www.unknowncheats.me/forum/members/3298005.html)
*/
// Constructor
Mouse::Mouse(GFCK* gfck) : gfck(gfck) {
// Check Connection
if (!gfck->isOpen())
{
gfck->open();}
}
// Destructor
Mouse::~Mouse() {
// Release Mouse Buttons
gfck->_sendMouse(0, 0, 0, 0);
gfck->close();
}
// Mouse Click
void Mouse::click(MouseButtons button) {
gfck->_sendMouse((char)button, 0, 0, 0);
Sleep(120);
gfck->_sendMouse(0, 0, 0, 0);
}
// Mouse Press and Hold
void Mouse::press(MouseButtons button) {
gfck->_sendMouse((char)button, 0, 0, 0);
}
// Mouse Release
void Mouse::release(MouseButtons button) {
gfck->_sendMouse(0, 0, 0, 0);
}
// Mouse Move Relative
void Mouse::move(int x, int y) {
gfck->_sendMouse(0, (char)x, (char)y, 0);
}
// Mouse Scroll -> Untested
void Mouse::scroll(int wheel) {
gfck->_sendMouse(0, 0, 0, (char)wheel);
}
/*
## Github: [Villageslayer](https://github.com/villageslayer)
## UC: [Villageslayer](https://www.unknowncheats.me/forum/members/3298005.html)
*/