Multimedia HID Keyboard Arduino Mega 2560

Hi,

I'm trying to build a keyboard for my android tablet.

I fallowed the guide here

and use this hex .
http://hunt.net.nz/users/darran/weblog/b3029/Arduino_UNO_Keyboard_HID_version_03.html

The only buttons that are working are VOL_UP, VOL_DOWN, MUTE and HOME. I don't know where I'm wrong because I use the android official page to get the HID hex key. The next_song and the page 0x0c HID consumer page are not working.

Any suggestions?
Thanks

This is my ino file:

#define KEY_LEFT_ALT 0x04
uint8_t buf[8] = { 0 };

#define MAPS 1
#define TEL 2
#define MUSIC 3
#define VOL_UP 4
#define VOL_DOWN 5
#define MUTE 6
#define FRW 7
#define BCW 8
#define REAR 9
#define HOME 10

int state = 1;

void setup()
{
Serial.begin(9600);

pinMode(MAPS, INPUT);
pinMode(TEL, INPUT);
pinMode(MUSIC, INPUT);
pinMode(VOL_UP, INPUT);
pinMode(VOL_DOWN, INPUT);
pinMode(MUTE, INPUT);
pinMode(FRW, INPUT);
pinMode(BCW, INPUT);
pinMode(REAR, INPUT);
pinMode(HOME, INPUT);

digitalWrite(MAPS, 1);
digitalWrite(TEL, 1);
digitalWrite(MUSIC, 1);
digitalWrite(VOL_UP, 1);
digitalWrite(VOL_DOWN, 1);
digitalWrite(MUTE, 1);
digitalWrite(FRW, 1);
digitalWrite(BCW, 1);
digitalWrite(REAR, 1);
digitalWrite(HOME, 1);

delay(200);
}

void loop()
{
//open Google maps
state = digitalRead(MAPS);
if (state != 1) {
buf[2] = 0x0004;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//open Phone
state = digitalRead(TEL);
if (state != 1) {
buf[1] = 0x0c; //HID page
buf[2] = 0x008c; //HID key
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//open Play Music
state = digitalRead(MUSIC);
if (state != 1) {
buf[1] = 0x0c; //HID page
buf[2] = 0x0183;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//volume up
state = digitalRead(VOL_UP);
if (state != 1) {
buf[1] = 0x07; //HID page
buf[2] = 0x0080;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//volume down
state = digitalRead(VOL_DOWN);
if (state != 1) {
buf[1] = 0x07; //HID page
buf[2] = 0x0081;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//MUTE KEY
if (digitalRead(VOL_UP) == 0 && digitalRead(VOL_DOWN) == 0) {
buf[1] = 0x07; //HID page
buf[2] = 0x007f; // Mute key
Serial.write(buf, 8); // Send keypress
releaseKey();
delay(300);
}

//next song
state = digitalRead(FRW);
if (state != 1) {
buf[1] = 0x07; //HID page
buf[2] = 0x00eb;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//previous song
state = digitalRead(BCW);
if (state != 1) {
buf[1] = 0x07; //HID page
buf[2] = 0x00ea;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//open Camera app
state = digitalRead(REAR);
if (state != 1) {
buf[1] = 0x07; //HID page
buf[2] = 0x00fa;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

//go HOME
state = digitalRead(HOME);
if (state != 1) {
buf[0] = KEY_LEFT_ALT;
buf[1] = 0x07; //HID page
buf[2] = 0x0029;
Serial.write(buf, 8);
releaseKey();
delay(300);
}

}

void releaseKey()
{
buf[0] = 0;
buf[1] = 0;
buf[2] = 0;
Serial.write(buf, 8);
}