use leonardo as android button

hi all, sorry the question maybe very stupid.

basically, what I want to do is to use leonardo as 3 buttons (back/home/menu) for my android devices.

since i'm very amateurish at programming, the easiest way I think is to works as a keyboard.

  if(!digitalRead(backkey))
  {Keyboard.press(KEY_ESC);}
  else
  {Keyboard.release(KEY_ESC);}

This works okay, but the home and menu button seems not working.

after that, I find this might be useful: https://source.android.com/devices/input/keyboard-devices.html But I don't know how exactly this works.

let's say home button for example, 0x0c 0x0223 AC Home 0x00ac KEY_HOMEPAGE 3.0 0x0003 KEYCODE_HOME

I tried to go with

  if(!digitalRead(backkey))
  {Keyboard.write(0x0c);
  Keyboard.write(0x0223);}

but not working.

so can anyone give me some help?

thanks

so can anyone give me some help?

What type (size) of value does Keyboard.write() take? Is 0x0223 that type (size)?