157 lines
3.6 KiB
C++
157 lines
3.6 KiB
C++
|
|
void donothing() { // Do nothing
|
|
}
|
|
void dolc() { // Do a left click
|
|
Mouse.release();
|
|
Mouse.click(MOUSE_LEFT);
|
|
Mouse.release();
|
|
todo = "";
|
|
}
|
|
void dolcd() { // Do a double left click
|
|
Mouse.release();
|
|
Mouse.press(MOUSE_LEFT);
|
|
delay(50);
|
|
Mouse.release();
|
|
delay(50);
|
|
Mouse.press(MOUSE_LEFT);
|
|
delay(50);
|
|
Mouse.release();
|
|
}
|
|
void dolch() { // Do a left click and hold
|
|
if (Mouse.isPressed(MOUSE_LEFT)) {
|
|
Mouse.release();
|
|
}
|
|
else{
|
|
Mouse.press(MOUSE_LEFT);
|
|
}
|
|
}
|
|
void dorc() { // Do a right click
|
|
Mouse.release();
|
|
Mouse.click(MOUSE_RIGHT);
|
|
Mouse.release();
|
|
}
|
|
void dorcd() { // Do a double right click
|
|
Mouse.release();
|
|
Mouse.press(MOUSE_RIGHT);
|
|
delay(50);
|
|
Mouse.release();
|
|
delay(50);
|
|
Mouse.press(MOUSE_RIGHT);
|
|
delay(50);
|
|
Mouse.release();
|
|
}
|
|
void dorch() { // Do a left click and hold
|
|
if (Mouse.isPressed(MOUSE_RIGHT)) {
|
|
Mouse.release();
|
|
}
|
|
else{
|
|
Mouse.press(MOUSE_RIGHT);
|
|
}
|
|
}
|
|
void moveup() { // Move the mouse cursor up
|
|
Mouse.move(0, -cursorspeed);
|
|
digitalWrite(LedMoozy, true);
|
|
delay(5);
|
|
}
|
|
void movedown() { // Move the mouse cursor down
|
|
Mouse.move(0, cursorspeed);
|
|
digitalWrite(LedMoozy, true);
|
|
delay(5);
|
|
}
|
|
void moveright() { // Move the mouse cursor to the right
|
|
Mouse.move(cursorspeed, 0);
|
|
digitalWrite(LedMoozy, true);
|
|
delay(5);
|
|
}
|
|
void moveleft() { // Move the mouse cursor to the left
|
|
Mouse.move(-cursorspeed, 0);
|
|
digitalWrite(LedMoozy, true);
|
|
delay(5);
|
|
}
|
|
void moveupright() { // Move the mouse cursor to the diag up and right
|
|
Mouse.move(cursorspeed, -cursorspeed);
|
|
}
|
|
void moveupleft() { // Move the mouse cursor to the diag up and left
|
|
Mouse.move(-cursorspeed, -cursorspeed);
|
|
}
|
|
void movedownright() { // Move the mouse cursor to the diag down and right
|
|
Mouse.move(cursorspeed, cursorspeed);
|
|
}
|
|
void movedownleft() { // Move the mouse cursor to the diag down and left
|
|
Mouse.move(-cursorspeed, cursorspeed);
|
|
}
|
|
void doscrollup() { // Move the wheel cursor up
|
|
Mouse.move(0, 0, cursorspeed);
|
|
}
|
|
void doscrolldown() { // Move the wheel cursor down
|
|
Mouse.move(0, 0, -cursorspeed);
|
|
}
|
|
void tospeed1() { // Change to the speed 1
|
|
cursorspeed = speed1 / 10;
|
|
currentspeed = 1;
|
|
}
|
|
void tospeed2() { // Change to the speed 2
|
|
cursorspeed = speed2 / 10;
|
|
currentspeed = 2;
|
|
}
|
|
void tospeed3() { // Change to the speed 3
|
|
cursorspeed = speed3 / 10;
|
|
currentspeed = 3;
|
|
}
|
|
void incspeed() { // Increase actual speed (max is 100)
|
|
switch (currentspeed) {
|
|
case 1:
|
|
speed1 = speed1 + 10;
|
|
if (speed1 >=100)
|
|
speed1 = 100;
|
|
cursorspeed = speed1 / 10;
|
|
break;
|
|
case 2:
|
|
speed2 = speed2 + 10;
|
|
if (speed2 >=100)
|
|
speed2 = 100;
|
|
cursorspeed = speed2 / 10;
|
|
break;
|
|
case 3:
|
|
speed3 = speed3 + 10;
|
|
if (speed3 >=100)
|
|
speed3 = 100;
|
|
cursorspeed = speed3 / 10;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
void decspeed() { // Decrease actual speed (min is 0)
|
|
switch (currentspeed) {
|
|
case 1:
|
|
speed1 = speed1 - 10;
|
|
if (speed1 <= 0)
|
|
speed1 = 0;
|
|
cursorspeed = speed1 / 10;
|
|
break;
|
|
case 2:
|
|
speed2 = speed2 - 10;
|
|
if (speed2 <= 0)
|
|
speed2 = 0;
|
|
cursorspeed = speed2 / 10;
|
|
break;
|
|
case 3:
|
|
speed3 = speed3 - 10;
|
|
if (speed3 <= 0)
|
|
speed3 = 0;
|
|
cursorspeed = speed3 / 10;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
void tomode1() { // Switch to mode 1
|
|
|
|
}
|
|
void tomode2() { // Switch to mode
|
|
|
|
}
|
|
void tomode3() { // Switch to mode
|
|
|
|
} |