Noob question... Reset Arduino

Spacemelody:
the board will input test into the sketch while I am trying to upload it.

Only if you have the editor portion of the Arduino IDE selected.

Consider your code:

Spacemelody:

  if(digitalRead(fx1)==HIGH){

Keyboard.print("test");
  }

The simplest way to make it stop typing is to merely connect pin 0 to GND. Then it will not read HIGH and the Keyboard.print() statement won't run.