Arduino Leonardo not acting like a keyboard

My project is a skype auto dialer and auto hang up after a defined time, and for the safety there's a ready switch I can compile the sketch,when the switch is LOW the green led blinks and the red stay off when the switch is HIGH both status LED are on but i can't get the key strokes.

Here is the code:

#include "Keyboard.h"

#define OSX 0
#define WINDOWS 1
#define LINUX 2
#define RDY_SW 2 //ready switch pin
#define LEDR 3 //red led pin
#define LEDG 4 // green led pin
#define CALL_INTERVAL 5000 //interval between calls
#define CALL_TIME 6000 //maximum time of the call

//for now the phone number to be dialed is hardcoded
char phone[] = "+00000000000000"; 
// change this to match your platform:
int platform = WINDOWS;

void setup() {
  // put your setup code here, to run once:
  pinMode(RDY_SW, INPUT_PULLUP);
  pinMode(LEDG,OUTPUT);
  pinMode(LEDR,OUTPUT);
  Keyboard.begin();
  digitalWrite(LEDG,HIGH);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LEDG,HIGH);
  digitalWrite(LEDR,LOW);
  delay(1000);
  if(digitalRead(RDY_SW) == HIGH){
    digitalWrite(LEDG,HIGH);
    digitalWrite(LEDR,HIGH);
    switch (platform) {
      case OSX:
        delay(1000);
        //not developed yet
        break;
      case WINDOWS:
        // Open Execute box:
        Keyboard.press(KEY_LEFT_GUI);
        Keyboard.press(0x52); //R
        delay(100);
        Keyboard.releaseAll();
        //Type the command
        Keyboard.print("skype /callto:");
        Keyboard.print(phone);
        Keyboard.press(KEY_RETURN);
        delay(100);
        Keyboard.releaseAll();
        //wait the calltime
        delay(CALL_TIME);
        //Hang-up using the shortkey
        Keyboard.press(KEY_LEFT_ALT);
        Keyboard.press(KEY_F8);
        delay(100);
        Keyboard.releaseAll();
        digitalWrite(LEDR,LOW);
        break;
      case LINUX:
        //not developed yet
        delay(1000);
        break;
    } 
  }
  digitalWrite(LEDG,LOW);
  delay(1000);
}

Windows device manager: |500x362

Hum looking at your code it seems you say you are ignoring MacOS at this stage but when doing this

Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(0x52); //R

it's probably a modifier key for a mac. if you want to send the control key on windows, it's KEY_LEFT_CTRL. Also if you send a capital 'R' (0x52), you are actually sending SHIFT and 'r' - is that what you want?

I think the intention is to press Windows-R, which opens the Run Command dialog.

J-M-L: Hum looking at your code it seems you say you are ignoring MacOS at this stage but when doing this

Keyboard.press(KEY_LEFT_GUI);
Keyboard.press(0x52); //R

it's probably a modifier key for a mac. if you want to send the control key on windows, it's KEY_LEFT_CTRL. Also if you send a capital 'R' (0x52), you are actually sending SHIFT and 'r' - is that what you want?

I meant to open "run" dialog box (windows key) +r , but beside this none of the keystrokes is sent, neither the Keyboard.print()

if you try this with a text editor open, what do you see?

#include "Keyboard.h"

void setup() {
  Keyboard.begin();
  Keyboard.print("Hello World\n");
}

void loop() {}

if that does not work, then look at your usb cable, power etc

J-M-L: if you try this with a text editor open, what do you see?

#include "Keyboard.h"

void setup() {   Keyboard.begin();   Keyboard.print("Hello World\n"); }

void loop() {}


if that does not work, then look at your usb cable, power etc

No offense intended but i'm not dumb, if uploading the sketch is fine than the USB cable is obviously fine,but i'm already did changed between 3 cables that i know it works, tried differents usb ports(that can supply power to an external hdd fine). And no, your code dont work aswell. I will try to run on my linux installation to see if it works, but the problem is: its not working on windows.

EDIT: It don't work on linux either, however the TX led blink when the AVR is sending the keystroke.

EDIT2: It works on another machine that i dont have arduino ide installed.

there is another way to upload code - you can bypass the bootloader and program the microcontroller through the ICSP

No offense taken and hopefully none on your side either.

May I assume the console is closed?

J-M-L: there is another way to upload code - you can bypass the bootloader and program the microcontroller through the ICSP

No offense taken and hopefully none on your side either.

May I assume the console is closed?

sure i managed to get this working, on this pc, i really dont know why but this pc only accept the arduino keyboard input when the avr is connected as soon as the computer execute the post. Now i'm having another problem I need to figure out the Windows Key code, because KEY_LEFT_GUI does nothing.