|
|
|
@ -30,14 +30,11 @@ class NoMouse {
|
|
|
|
|
void begin() {}
|
|
|
|
|
void sendReport() {}
|
|
|
|
|
void move(int8_t x, int8_t y, int8_t vWheel, int8_t hWheel) {}
|
|
|
|
|
void stop(bool x, bool y, bool vWheel, bool hWheel) {}
|
|
|
|
|
void releaseAll() {}
|
|
|
|
|
void press(uint8_t buttons) {}
|
|
|
|
|
void release(uint8_t buttons) {}
|
|
|
|
|
void click(uint8_t buttons) {}
|
|
|
|
|
HID_MouseReport_Data_t getReport() {
|
|
|
|
|
static HID_MouseReport_Data_t report;
|
|
|
|
|
return report;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct MouseProps {
|
|
|
|
@ -63,17 +60,7 @@ class Mouse {
|
|
|
|
|
mouse_.move(x, y, vWheel, hWheel);
|
|
|
|
|
}
|
|
|
|
|
void stop(bool x, bool y, bool vWheel = false, bool hWheel = false) {
|
|
|
|
|
HID_MouseReport_Data_t report = mouse_.getReport();
|
|
|
|
|
|
|
|
|
|
if (x)
|
|
|
|
|
report.xAxis = 0;
|
|
|
|
|
if (y)
|
|
|
|
|
report.yAxis = 0;
|
|
|
|
|
if (vWheel)
|
|
|
|
|
report.vWheel = 0;
|
|
|
|
|
if (hWheel)
|
|
|
|
|
report.hWheel = 0;
|
|
|
|
|
move(report.xAxis, report.yAxis, report.vWheel, report.hWheel);
|
|
|
|
|
mouse_.stop(x, y, vWheel, hWheel);
|
|
|
|
|
}
|
|
|
|
|
void releaseAllButtons() {
|
|
|
|
|
mouse_.releaseAll();
|
|
|
|
|