// Geekble 몰컴 버튼 - Mac용
#include <Keyboard.h>

int prevInput = 1;
bool isActivate = false;

void setup() {
  Keyboard.begin();
  pinMode(2, INPUT_PULLUP);
}

void loop() {
  int nowInput = digitalRead(2);

  if(nowInput == 0){
    if(prevInput == 1){
      Keyboard.press(KEY_LEFT_CTRL);
      if(!isActivate)
        Keyboard.press(KEY_RIGHT_ARROW);
      else
        Keyboard.press(KEY_LEFT_ARROW);
      Keyboard.releaseAll();
      isActivate = !isActivate;
		}
  }

  prevInput = nowInput;
  delay(100);
}