Solved

Thanks for all the help. here is the code. It’s compatible with Leonardo , Micro , Due , Zero and Esplora boards.

#include <Keyboard.h>

void setup() {
  // put your setup code here, to run once:
 delay(5000);
 Keyboard.begin() ;
 Keyboard.press(0x87) ;
 Keyboard.press('r') ;
 Keyboard.releaseAll()  ;
 delay(1000);
 Keyboard.print("browser of your choice") ; 
 delay(500);
 Keyboard.press(0xB0);
 Keyboard.releaseAll();
 delay(500);
 Keyboard.print("website of your choice");
 Keyboard.press(0xB0); 
 Keyboard.releaseAll();
 Keyboard.end();




































 
 Keyboard.end() ; 
}

void loop() {
  // put your main code here, to run repeatedly:
}

Do you get further if you do this ?

#include <Keyboard.h>

void setup() {
  // put your setup code here, to run once:
 Keyboard.begin() ;
 Keyboard.press(0x5B) ;
 Keyboard.press('R') ;
 Keyboard.releaseAll()  ;
 Keyboard.write("Chrome.exe") ; 
 Keyboard.end() ; 
}

void loop() {
  // put your main code here, to run repeatedly:
}

edit: added “;” etc.

Now it doesn’t seem to recognise ‘Keyboard’ as a command at all. I do have the keyboard. h and .cpp files in the right place but it still doesn’t seem to work. it just says ‘Keyboard’ not found. Does your sketch include the line #include <Keyboard.h>?’

povalljames:
I do have the keyboard. h and .cpp files in the right place

What is the right place? It's a standard library that comes with the Arduino installation and on a Windows system the library is located at C:\Program Files (x86)\Arduino\libraries\Keyboard\src.

The code given by @6v6gt contains one mistake, it should be Keyboard.print("Chrome.exe") ; instead of Keyboard.write("Chrome.exe") ;.
After fixing that it compiles (IDE 1.6.7).

Do you have the correct target board selected?

Tools > Board > Arduino/Genuino Micro