Macro.h

mail@pastecode.io avatar
unknown
c_cpp
a month ago
1.9 kB
3
Indexable
Never
#ifndef SCRIPTS_h
#define SCRIPTS_h

#include <Keyboard.h>
#include <Mouse.h>
#include <Macro.h>

void setupScripts(byte keyboardLayoutID = 0);

struct RandomMouseMoveData : MacroData {
  uint8_t speed;
  bool arc;
  float timeSinceLastUpdateMillis;
  uint16_t maxLength;
  uint16_t currentLength;

  float lineDirX;
  float lineDirY;

  float arcStartAngleRad;
  float arcEndAngleRad;
  float arcRadius;

  float behindX;
  float behindY;

  RandomMouseMoveData() : speed(0), arc(false), timeSinceLastUpdateMillis(0), maxLength(0), currentLength(0), lineDirX(0), lineDirY(0),
                          arcStartAngleRad(0), arcEndAngleRad(0), arcRadius(0), behindX(0), behindY(0) {}

  void print() {
    Serial.print("Random Mouse Move Data: ");
    Serial.println();
    Serial.print("Speed: ");
    Serial.print(speed);
    Serial.println();
    Serial.print("Arc: ");
    Serial.print(arc ? "true" : "false");
    Serial.print(", Time Since Last Update (ms): ");    
    Serial.print(timeSinceLastUpdateMillis);
    Serial.print(", Max Length: ");
    Serial.print(maxLength);
    Serial.print(", Current Length: ");
    Serial.print(currentLength);
    if (arc) {
      Serial.print(", Arc Start Angle (rad): ");
      Serial.print(arcStartAngleRad);
      Serial.print(", Arc End Angle (rad): ");
      Serial.print(arcEndAngleRad);
      Serial.print(", Arc Radius: ");
      Serial.print(arcRadius);      
    } else {
      Serial.print(", Behind X: ");
      Serial.print(behindX);
      Serial.print(", Behind Y: ");
      Serial.println(behindY);
    }
  }
};
void moveMouseRandomly(RepeatedMacroEvent* event);
void fakeWinUpdate(NormalMacroEvent* event);
void shutdown(NormalMacroEvent* event);
void logout(NormalMacroEvent* event);
void remoteDesktop(NormalMacroEvent* event);

#endif
Leave a Comment