kKey convert_key(int android_key)
{
#define CASE(K,V) case K: return V;
    switch(android_key)
    {
    CASE(AKEYCODE_UNKNOWN, kKey::Unknown);
    CASE(AKEYCODE_SOFT_LEFT, kKey::Unknown);
    CASE(AKEYCODE_SOFT_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_HOME, kKey::AndroidHome);
    CASE(AKEYCODE_BACK, kKey::AndroidBack);
    CASE(AKEYCODE_CALL, kKey::Unknown);
    CASE(AKEYCODE_ENDCALL, kKey::Unknown);
    CASE(AKEYCODE_0, kKey::Unknown);
    CASE(AKEYCODE_1, kKey::Unknown);
    CASE(AKEYCODE_2, kKey::Unknown);
    CASE(AKEYCODE_3, kKey::Unknown);
    CASE(AKEYCODE_4, kKey::Unknown);
    CASE(AKEYCODE_5, kKey::Unknown);
    CASE(AKEYCODE_6, kKey::Unknown);
    CASE(AKEYCODE_7, kKey::Unknown);
    CASE(AKEYCODE_8, kKey::Unknown);
    CASE(AKEYCODE_9, kKey::Unknown);
    CASE(AKEYCODE_STAR, kKey::Unknown);
    CASE(AKEYCODE_POUND, kKey::Unknown);
    CASE(AKEYCODE_DPAD_UP, kKey::Unknown);
    CASE(AKEYCODE_DPAD_DOWN, kKey::Unknown);
    CASE(AKEYCODE_DPAD_LEFT, kKey::Unknown);
    CASE(AKEYCODE_DPAD_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_DPAD_CENTER, kKey::Unknown);
    CASE(AKEYCODE_VOLUME_UP, kKey::AndroidVolumeUp);
    CASE(AKEYCODE_VOLUME_DOWN, kKey::AndroidVolumeDown);
    CASE(AKEYCODE_POWER, kKey::Unknown);
    CASE(AKEYCODE_CAMERA, kKey::Unknown);
    CASE(AKEYCODE_CLEAR, kKey::Unknown);
    CASE(AKEYCODE_A, kKey::Unknown);
    CASE(AKEYCODE_B, kKey::Unknown);
    CASE(AKEYCODE_C, kKey::Unknown);
    CASE(AKEYCODE_D, kKey::Unknown);
    CASE(AKEYCODE_E, kKey::Unknown);
    CASE(AKEYCODE_F, kKey::Unknown);
    CASE(AKEYCODE_G, kKey::Unknown);
    CASE(AKEYCODE_H, kKey::Unknown);
    CASE(AKEYCODE_I, kKey::Unknown);
    CASE(AKEYCODE_J, kKey::Unknown);
    CASE(AKEYCODE_K, kKey::Unknown);
    CASE(AKEYCODE_L, kKey::Unknown);
    CASE(AKEYCODE_M, kKey::Unknown);
    CASE(AKEYCODE_N, kKey::Unknown);
    CASE(AKEYCODE_O, kKey::Unknown);
    CASE(AKEYCODE_P, kKey::Unknown);
    CASE(AKEYCODE_Q, kKey::Unknown);
    CASE(AKEYCODE_R, kKey::Unknown);
    CASE(AKEYCODE_S, kKey::Unknown);
    CASE(AKEYCODE_T, kKey::Unknown);
    CASE(AKEYCODE_U, kKey::Unknown);
    CASE(AKEYCODE_V, kKey::Unknown);
    CASE(AKEYCODE_W, kKey::Unknown);
    CASE(AKEYCODE_X, kKey::Unknown);
    CASE(AKEYCODE_Y, kKey::Unknown);
    CASE(AKEYCODE_Z, kKey::Unknown);
    CASE(AKEYCODE_COMMA, kKey::Unknown);
    CASE(AKEYCODE_PERIOD, kKey::Unknown);
    CASE(AKEYCODE_ALT_LEFT, kKey::Unknown);
    CASE(AKEYCODE_ALT_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_SHIFT_LEFT, kKey::Unknown);
    CASE(AKEYCODE_SHIFT_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_TAB, kKey::Unknown);
    CASE(AKEYCODE_SPACE, kKey::Unknown);
    CASE(AKEYCODE_SYM, kKey::Unknown);
    CASE(AKEYCODE_EXPLORER, kKey::Unknown);
    CASE(AKEYCODE_ENVELOPE, kKey::Unknown);
    CASE(AKEYCODE_ENTER, kKey::KeyEnter);
    CASE(AKEYCODE_DEL, kKey::KeyBackspace);
    CASE(AKEYCODE_GRAVE, kKey::Unknown);
    CASE(AKEYCODE_MINUS, kKey::Unknown);
    CASE(AKEYCODE_EQUALS, kKey::Unknown);
    CASE(AKEYCODE_LEFT_BRACKET, kKey::Unknown);
    CASE(AKEYCODE_RIGHT_BRACKET, kKey::Unknown);
    CASE(AKEYCODE_BACKSLASH, kKey::Unknown);
    CASE(AKEYCODE_SEMICOLON, kKey::Unknown);
    CASE(AKEYCODE_APOSTROPHE, kKey::Unknown);
    CASE(AKEYCODE_SLASH, kKey::Unknown);
    CASE(AKEYCODE_AT, kKey::Unknown);
    CASE(AKEYCODE_NUM, kKey::Unknown);
    CASE(AKEYCODE_HEADSETHOOK, kKey::Unknown);
    CASE(AKEYCODE_FOCUS, kKey::Unknown);
    CASE(AKEYCODE_PLUS, kKey::Unknown);
    CASE(AKEYCODE_MENU, kKey::Unknown);
    CASE(AKEYCODE_NOTIFICATION, kKey::Unknown);
    CASE(AKEYCODE_SEARCH, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_PLAY_PAUSE, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_STOP, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_NEXT, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_PREVIOUS, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_REWIND, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_FAST_FORWARD, kKey::Unknown);
    CASE(AKEYCODE_MUTE, kKey::Unknown);
    CASE(AKEYCODE_PAGE_UP, kKey::Unknown);
    CASE(AKEYCODE_PAGE_DOWN, kKey::Unknown);
    CASE(AKEYCODE_PICTSYMBOLS, kKey::Unknown);
    CASE(AKEYCODE_SWITCH_CHARSET, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_A, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_B, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_C, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_X, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_Y, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_Z, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_L1, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_R1, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_L2, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_R2, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_THUMBL, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_THUMBR, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_START, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_SELECT, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_MODE, kKey::Unknown);
    CASE(AKEYCODE_ESCAPE, kKey::Unknown);
    CASE(AKEYCODE_FORWARD_DEL, kKey::Unknown);
    CASE(AKEYCODE_CTRL_LEFT, kKey::Unknown);
    CASE(AKEYCODE_CTRL_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_CAPS_LOCK, kKey::Unknown);
    CASE(AKEYCODE_SCROLL_LOCK, kKey::Unknown);
    CASE(AKEYCODE_META_LEFT, kKey::Unknown);
    CASE(AKEYCODE_META_RIGHT, kKey::Unknown);
    CASE(AKEYCODE_FUNCTION, kKey::Unknown);
    CASE(AKEYCODE_SYSRQ, kKey::Unknown);
    CASE(AKEYCODE_BREAK, kKey::Unknown);
    CASE(AKEYCODE_MOVE_HOME, kKey::Unknown);
    CASE(AKEYCODE_MOVE_END, kKey::Unknown);
    CASE(AKEYCODE_INSERT, kKey::Unknown);
    CASE(AKEYCODE_FORWARD, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_PLAY, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_PAUSE, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_CLOSE, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_EJECT, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_RECORD, kKey::Unknown);
    CASE(AKEYCODE_F1, kKey::Unknown);
    CASE(AKEYCODE_F2, kKey::Unknown);
    CASE(AKEYCODE_F3, kKey::Unknown);
    CASE(AKEYCODE_F4, kKey::Unknown);
    CASE(AKEYCODE_F5, kKey::Unknown);
    CASE(AKEYCODE_F6, kKey::Unknown);
    CASE(AKEYCODE_F7, kKey::Unknown);
    CASE(AKEYCODE_F8, kKey::Unknown);
    CASE(AKEYCODE_F9, kKey::Unknown);
    CASE(AKEYCODE_F10, kKey::Unknown);
    CASE(AKEYCODE_F11, kKey::Unknown);
    CASE(AKEYCODE_F12, kKey::Unknown);
    CASE(AKEYCODE_NUM_LOCK, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_0, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_1, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_2, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_3, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_4, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_5, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_6, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_7, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_8, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_9, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_DIVIDE, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_MULTIPLY, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_SUBTRACT, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_ADD, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_DOT, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_COMMA, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_ENTER, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_EQUALS, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_LEFT_PAREN, kKey::Unknown);
    CASE(AKEYCODE_NUMPAD_RIGHT_PAREN, kKey::Unknown);
    CASE(AKEYCODE_VOLUME_MUTE, kKey::Unknown);
    CASE(AKEYCODE_INFO, kKey::Unknown);
    CASE(AKEYCODE_CHANNEL_UP, kKey::Unknown);
    CASE(AKEYCODE_CHANNEL_DOWN, kKey::Unknown);
    CASE(AKEYCODE_ZOOM_IN, kKey::Unknown);
    CASE(AKEYCODE_ZOOM_OUT, kKey::Unknown);
    CASE(AKEYCODE_TV, kKey::Unknown);
    CASE(AKEYCODE_WINDOW, kKey::Unknown);
    CASE(AKEYCODE_GUIDE, kKey::Unknown);
    CASE(AKEYCODE_DVR, kKey::Unknown);
    CASE(AKEYCODE_BOOKMARK, kKey::Unknown);
    CASE(AKEYCODE_CAPTIONS, kKey::Unknown);
    CASE(AKEYCODE_SETTINGS, kKey::Unknown);
    CASE(AKEYCODE_TV_POWER, kKey::Unknown);
    CASE(AKEYCODE_TV_INPUT, kKey::Unknown);
    CASE(AKEYCODE_STB_POWER, kKey::Unknown);
    CASE(AKEYCODE_STB_INPUT, kKey::Unknown);
    CASE(AKEYCODE_AVR_POWER, kKey::Unknown);
    CASE(AKEYCODE_AVR_INPUT, kKey::Unknown);
    CASE(AKEYCODE_PROG_RED, kKey::Unknown);
    CASE(AKEYCODE_PROG_GREEN, kKey::Unknown);
    CASE(AKEYCODE_PROG_YELLOW, kKey::Unknown);
    CASE(AKEYCODE_PROG_BLUE, kKey::Unknown);
    CASE(AKEYCODE_APP_SWITCH, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_1, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_2, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_3, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_4, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_5, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_6, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_7, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_8, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_9, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_10, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_11, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_12, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_13, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_14, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_15, kKey::Unknown);
    CASE(AKEYCODE_BUTTON_16, kKey::Unknown);
    CASE(AKEYCODE_LANGUAGE_SWITCH, kKey::Unknown);
    CASE(AKEYCODE_MANNER_MODE, kKey::Unknown);
    CASE(AKEYCODE_3D_MODE, kKey::Unknown);
    CASE(AKEYCODE_CONTACTS, kKey::Unknown);
    CASE(AKEYCODE_CALENDAR, kKey::Unknown);
    CASE(AKEYCODE_MUSIC, kKey::Unknown);
    CASE(AKEYCODE_CALCULATOR, kKey::Unknown);
    CASE(AKEYCODE_ZENKAKU_HANKAKU, kKey::Unknown);
    CASE(AKEYCODE_EISU, kKey::Unknown);
    CASE(AKEYCODE_MUHENKAN, kKey::Unknown);
    CASE(AKEYCODE_HENKAN, kKey::Unknown);
    CASE(AKEYCODE_KATAKANA_HIRAGANA, kKey::Unknown);
    CASE(AKEYCODE_YEN, kKey::Unknown);
    CASE(AKEYCODE_RO, kKey::Unknown);
    CASE(AKEYCODE_KANA, kKey::Unknown);
    CASE(AKEYCODE_ASSIST, kKey::Unknown);
    CASE(AKEYCODE_BRIGHTNESS_DOWN, kKey::Unknown);
    CASE(AKEYCODE_BRIGHTNESS_UP, kKey::Unknown);
    CASE(AKEYCODE_MEDIA_AUDIO_TRACK, kKey::Unknown);
    default: 
        return kKey::Unknown;
    }
}