 
 #include <SPI.h>
 #include <SD.h>
-#include "Keyboard.h"
+#include <Keyboard.h>
+#include <Mouse.h>
 
 #define debug true // <-- uncomment to turn serial output on
 #define CSpin 4 //Chip-Select of the SD-Card reader


File payload;
char* buf = malloc(sizeof(char)*buffersize);
int bufSize = 0;
int defaultDelay = 5;
int defaultCharDelay = 5;
bool ledOn = true;

char* repeatBuffer = malloc(sizeof(char)*12);

int getSpace(int start, int end){
  for(int i=start;i<end;i++){

    else if(equalsBuffer(0,space,"STRING")){
      for(int i=space+1;i<bufSize;i++) KeyboardWrite(buf[i]);
    }
    else if(equalsBuffer(0,space,"MOUSE")){
      int nSpace = getSpace(space+1,bufSize);
      int x = getInt(buf,space);
      int y = getInt(buf,nSpace);
      Mouse.move(x,y);
      #ifdef debug 
        Serial.println("Move mouse "+(String)x+" "+(String)y);
      #endif
    }
    else if(equalsBuffer(0,space,"SCROLL")) Mouse.move(0,0,getInt(buf,space));
    else if(equalsBuffer(0,space,"RANDOMMIN")) rMin = getInt(buf,space);
    else if(equalsBuffer(0,space,"RANDOMMAX")) rMax = getInt(buf,space);
    else if(equalsBuffer(0,space,"REM") || equalsBuffer(0,space,"REPEAT")){}
    else{
      runCommand(0,space);
