 
 Encoder encoder(2, 3);
 ClickButton rec_button(4, LOW, CLICKBTN_PULLUP);
-int button_state = 0;
+ClickButton abort_button(7, LOW, CLICKBTN_PULLUP);
+int rec_button_state = 0;
+int abort_button_state = 0;
 
 void setup() {
   Serial.begin(9600);

  rec_button.debounceTime   = 20;   // Debounce timer in ms
  rec_button.multiclickTime = 250;  // Time limit for multi clicks
  rec_button.longClickTime  = 2500; // time until "held-down clicks" register
}

long pos  = -999;

    last_value = act_value;
  }


  rec_button.Update();
  rec_button_state = rec_button.clicks;
  if(rec_button_state == 1){ // single click
    Keyboard.press('r');
    Keyboard.release('r');
  }

  abort_button.Update();
  abort_button_state = abort_button.clicks;
  if(abort_button_state == 1){ // single click
    Keyboard.press('e');
    Keyboard.release('e');
  }


//  else if(button_state == 2){ // double click
//    Keyboard.press('p');
//    Keyboard.release('p');
//  }else if(button_state == -1){ // long press
//    Keyboard.press(KEY_ESC);
//    Keyboard.release(KEY_ESC);
//  }
}