-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMouseHIDSub.h
29 lines (24 loc) · 993 Bytes
/
MouseHIDSub.h
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
#pragma once
#define MOUSE_LEFT 1
#define MOUSE_RIGHT 2
#define MOUSE_MIDDLE 4
#define MOUSE_BACK 8
#define MOUSE_FORWARD 16
#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE) # For compatibility with the Mouse library
class MouseHIDSub : public BleHIDSubBase
{
public:
void click(uint8_t b = MOUSE_LEFT);
void move(signed char x, signed char y, signed char wheel = 0, signed char hWheel = 0);
void press(uint8_t b = MOUSE_LEFT); // press LEFT by default
void release(uint8_t b = MOUSE_LEFT); // release LEFT by default
bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default
// Return the HID descriptor for the device
virtual const uint8_t* GetHIDDecsriptor(int* NumBytes);
// Return the input and output characteristics of the device.
// Called multiple times, until the function returns 0. Index is the count.
virtual int GetInputReportIndex(int Index);
private:
uint8_t _buttons;
void buttons(uint8_t b);
};