Function Keys F2~F12

Just starting using Arduino today.
I have a Teensy programmed as a USB keyboard. Want to use pin 0 and 1 to program an F2 and F3 keystroke.

Here is my code.

 void setup(){
 Serial.begin(9600);
 pinMode(0, INPUT_PULLUP);
 pinMode(1, INPUT_PULLUP);
 delay(5000);
 }
 
  void loop(){
    if(digitalRead(0) ==LOW)
    { 
      Keyboard.print(KEY_F2);
            while (digitalRead(0) == LOW) {
        delay(10); // keep waiting until the key is released
            }
    }
    
    if(digitalRead(1) ==LOW)
    { 
      Keyboard.print(KEY_F3);
            while (digitalRead(1) == LOW) {
        delay(10); // keep waiting until the key is released

            }
            
    }
  }

when I press the button it return the number 59 or 60.

Anyone with and ideas?

Ross

And what is the problem? What did you expect?

I except to get the appropriate keystroke.

Paul from pjrc.com got me going.

Here is the final code

 void setup(){
 Serial.begin(9600);
 pinMode(0, INPUT_PULLUP);
 pinMode(1, INPUT_PULLUP);
 delay(5000);
 }

  void loop(){
    if(digitalRead(0) ==LOW)
    {
      Keyboard.set_key2(KEY_F2);
      Keyboard.send_now();
      Keyboard.set_key2(0);
      Keyboard.send_now();
      
        while (digitalRead(0) == LOW) {
        delay(10); // keep waiting until the key is released
      }
    }
    
    if(digitalRead(1) ==LOW)
    {
      Keyboard.set_key4(KEY_F4);
      Keyboard.send_now();
      Keyboard.set_key4(0);
      Keyboard.send_now();
           
        while (digitalRead(1) == LOW) {
        delay(10); // keep waiting until the key is released
      }    
    }
  }