Switching between two modes. (relative and absolute) on trackpad

The switch x | y routine was my novice attempt at adding acceleration to the mouse. Maybe there is a better way and i've taken the long route. (as usual..)

As far as the button goes, I meant to remove

  buttonState = HIGH;

etc from lines of code as it was a flag for some other snippet I wanted to use for double clicks etc. so please ignore.

Thanks for pointing out:

 prevButtonStates = rData.buttons;

It was in the incorrect place and belongs before trackpad read and after trackpad is available.


  switch (theMode) {
    case RELATIVE:
    
      if (trackpad.available()) {
       // currentMillis = millis();
           prevButtonStates = rData.buttons;  // for edge detection

        trackpad.read(&rData);

And that worked!

I really appreciate all your help, guidance, and above all humor!