src/native/globalshortcut/net_java_sip_communicator_impl_globalshortcut_NativeKeyboardHook.cpp
/**
 * \brief Convert Java keycode to native ones. 
 * \param keycode Java keycode
 * \return native Windows keycode
 */
\brief Convert Java keycode to native ones.
\ brief Convert Java keycode to native ones .
static int convertJavaKeycodeToWindows(int keycode)
{
    int ret = -1;
    switch(keycode)
    {
        case JVK_0:
            ret = VK_KEY_0;
            break;
        case JVK_1:
            ret = VK_KEY_1;
            break;
        case JVK_2:
            ret = VK_KEY_2;
            break;
        case JVK_3:
            ret = VK_KEY_3;
            break;
        case JVK_4:
            ret = VK_KEY_4;
            break;
        case JVK_5:
            ret = VK_KEY_5;
            break;
        case JVK_6:
            ret = VK_KEY_6;
            break;
        case JVK_7:
            ret = VK_KEY_7;
            break;
        case JVK_8:
            ret = VK_KEY_8;
            break;
        case JVK_9:
            ret = VK_KEY_9;
            break;
        case JVK_A:
            ret = VK_KEY_A;
            break;
        case JVK_B:
            ret = VK_KEY_B;
            break;
        case JVK_C:
            ret = VK_KEY_C;
            break;
        case JVK_D:
            ret = VK_KEY_D;
            break;
        case JVK_E:
            ret = VK_KEY_E;
            break;
        case JVK_F:
            ret = VK_KEY_F;
            break;
        case JVK_G:
            ret = VK_KEY_G;
            break;
        case JVK_H:
            ret = VK_KEY_H;
            break;
        case JVK_I:
            ret = VK_KEY_I;
            break;
        case JVK_J:
            ret = VK_KEY_J;
            break;
        case JVK_K:
            ret = VK_KEY_K;
            break;
        case JVK_L:
            ret = VK_KEY_L;
            break;
        case JVK_M:
            ret = VK_KEY_M;
            break;
        case JVK_N:
            ret = VK_KEY_N;
            break;
        case JVK_O:
            ret = VK_KEY_O;
            break;
        case JVK_P:
            ret = VK_KEY_P;
            break;
        case JVK_Q:
            ret = VK_KEY_Q;
            break;
        case JVK_R:
            ret = VK_KEY_R;
            break;
        case JVK_S:
            ret = VK_KEY_S;
            break;
        case JVK_T:
            ret = VK_KEY_T;
            break;
        case JVK_U:
            ret = VK_KEY_U;
            break;
        case JVK_V:
            ret = VK_KEY_V;
            break;
        case JVK_W:
            ret = VK_KEY_W;
            break;
        case JVK_X:
            ret = VK_KEY_X;
            break;
        case JVK_Y:
            ret = VK_KEY_Y;
            break;
        case JVK_Z:
            ret = VK_KEY_Z;
            break;
        case JVK_F1:
            ret = VK_F1;
            break;
        case JVK_F2:
            ret = VK_F2;
            break;
        case JVK_F3:
            ret = VK_F3;
            break;
        case JVK_F4:
            ret = VK_F4;
            break;
        case JVK_F5:
            ret = VK_F5;
            break;
        case JVK_F6:
            ret = VK_F6;
            break;
        case JVK_F7:
            ret = VK_F7;
            break;
        case JVK_F8:
            ret = VK_F8;
            break;
        case JVK_F9:
            ret = VK_F9;
            break;
        case JVK_F10:
            ret = VK_F10;
            break;
        case JVK_F11:
            ret = VK_F11;
            break;
        case JVK_F12:
            ret = VK_F12;
            break;
        case JVK_LEFT:
            ret = VK_LEFT;
            break;
        case JVK_RIGHT:
            ret = VK_RIGHT;
            break;
        case JVK_UP:
            ret = VK_UP;
            break;
        case JVK_DOWN:
            ret = VK_DOWN;
            break;
        case JVK_COMMA:
            ret = VK_OEM_COMMA;
            break;
        case JVK_MINUS:
            ret = VK_OEM_MINUS;
            break;
        case JVK_PLUS:
            ret = VK_ADD;
            break;
        case JVK_PERIOD:
            ret = VK_PERIOD;
            break;
        case JVK_SLASH:
            ret = VK_SLASH;
            break;
        case JVK_BACK_SLASH:
            ret = VK_OEM_5;
            break;
        case JVK_SEMICOLON:
            ret = VK_SEMICOLON;
            break;
        case JVK_EQUALS:
            ret = VK_OEM_PLUS;
            break;
        case JVK_COLON:
            ret = VK_COLON;
            break;
        case JVK_UNDERSCORE:
            ret = -1;
            break;
        case JVK_DOLLAR:
            ret = VK_DOLLAR; 
            break;
        case JVK_EXCLAMATION_MARK:
            ret = VK_OEM_8;
            break;
        case JVK_LESS:
            ret = VK_LESS;
            break;
        case JVK_GREATER:
            ret = VK_GREATER;
            break;
        case JVK_QUOTE:
            ret = -1;
            break;
        case JVK_BACK_QUOTE:
            ret = -1;
            break;
        case JVK_INSERT:
            ret = VK_INSERT;
            break;
        case JVK_HELP:
            ret = VK_ICO_HELP;
            break;
        case JVK_HOME:
            ret = VK_HOME;
            break;
        case JVK_END:
            ret = VK_END;
            break;
        case JVK_PAGE_UP:
            ret = VK_PRIOR;
            break;
        case JVK_PAGE_DOWN:
            ret = VK_NEXT;
            break;
        case JVK_OPEN_BRACKET:
            ret = VK_OEM_4;
            break;
        case JVK_CLOSE_BRACKET:
            ret = VK_OEM_6;
            break;
        case 0x08:
            ret = VK_DELETE;
            break;
        default:
            break;
    }
    return ret;
}
static int convertJavaKeycodeToWindows ( int keycode ) { int ret = -1 ; switch ( keycode ) { case JVK_0 : ret = VK_KEY_0 ; break ; case JVK_1 : ret = VK_KEY_1 ; break ; case JVK_2 : ret = VK_KEY_2 ; break ; case JVK_3 : ret = VK_KEY_3 ; break ; case JVK_4 : ret = VK_KEY_4 ; break ; case JVK_5 : ret = VK_KEY_5 ; break ; case JVK_6 : ret = VK_KEY_6 ; break ; case JVK_7 : ret = VK_KEY_7 ; break ; case JVK_8 : ret = VK_KEY_8 ; break ; case JVK_9 : ret = VK_KEY_9 ; break ; case JVK_A : ret = VK_KEY_A ; break ; case JVK_B : ret = VK_KEY_B ; break ; case JVK_C : ret = VK_KEY_C ; break ; case JVK_D : ret = VK_KEY_D ; break ; case JVK_E : ret = VK_KEY_E ; break ; case JVK_F : ret = VK_KEY_F ; break ; case JVK_G : ret = VK_KEY_G ; break ; case JVK_H : ret = VK_KEY_H ; break ; case JVK_I : ret = VK_KEY_I ; break ; case JVK_J : ret = VK_KEY_J ; break ; case JVK_K : ret = VK_KEY_K ; break ; case JVK_L : ret = VK_KEY_L ; break ; case JVK_M : ret = VK_KEY_M ; break ; case JVK_N : ret = VK_KEY_N ; break ; case JVK_O : ret = VK_KEY_O ; break ; case JVK_P : ret = VK_KEY_P ; break ; case JVK_Q : ret = VK_KEY_Q ; break ; case JVK_R : ret = VK_KEY_R ; break ; case JVK_S : ret = VK_KEY_S ; break ; case JVK_T : ret = VK_KEY_T ; break ; case JVK_U : ret = VK_KEY_U ; break ; case JVK_V : ret = VK_KEY_V ; break ; case JVK_W : ret = VK_KEY_W ; break ; case JVK_X : ret = VK_KEY_X ; break ; case JVK_Y : ret = VK_KEY_Y ; break ; case JVK_Z : ret = VK_KEY_Z ; break ; case JVK_F1 : ret = VK_F1 ; break ; case JVK_F2 : ret = VK_F2 ; break ; case JVK_F3 : ret = VK_F3 ; break ; case JVK_F4 : ret = VK_F4 ; break ; case JVK_F5 : ret = VK_F5 ; break ; case JVK_F6 : ret = VK_F6 ; break ; case JVK_F7 : ret = VK_F7 ; break ; case JVK_F8 : ret = VK_F8 ; break ; case JVK_F9 : ret = VK_F9 ; break ; case JVK_F10 : ret = VK_F10 ; break ; case JVK_F11 : ret = VK_F11 ; break ; case JVK_F12 : ret = VK_F12 ; break ; case JVK_LEFT : ret = VK_LEFT ; break ; case JVK_RIGHT : ret = VK_RIGHT ; break ; case JVK_UP : ret = VK_UP ; break ; case JVK_DOWN : ret = VK_DOWN ; break ; case JVK_COMMA : ret = VK_OEM_COMMA ; break ; case JVK_MINUS : ret = VK_OEM_MINUS ; break ; case JVK_PLUS : ret = VK_ADD ; break ; case JVK_PERIOD : ret = VK_PERIOD ; break ; case JVK_SLASH : ret = VK_SLASH ; break ; case JVK_BACK_SLASH : ret = VK_OEM_5 ; break ; case JVK_SEMICOLON : ret = VK_SEMICOLON ; break ; case JVK_EQUALS : ret = VK_OEM_PLUS ; break ; case JVK_COLON : ret = VK_COLON ; break ; case JVK_UNDERSCORE : ret = -1 ; break ; case JVK_DOLLAR : ret = VK_DOLLAR ; break ; case JVK_EXCLAMATION_MARK : ret = VK_OEM_8 ; break ; case JVK_LESS : ret = VK_LESS ; break ; case JVK_GREATER : ret = VK_GREATER ; break ; case JVK_QUOTE : ret = -1 ; break ; case JVK_BACK_QUOTE : ret = -1 ; break ; case JVK_INSERT : ret = VK_INSERT ; break ; case JVK_HELP : ret = VK_ICO_HELP ; break ; case JVK_HOME : ret = VK_HOME ; break ; case JVK_END : ret = VK_END ; break ; case JVK_PAGE_UP : ret = VK_PRIOR ; break ; case JVK_PAGE_DOWN : ret = VK_NEXT ; break ; case JVK_OPEN_BRACKET : ret = VK_OEM_4 ; break ; case JVK_CLOSE_BRACKET : ret = VK_OEM_6 ; break ; case 0x08 : ret = VK_DELETE ; break ; default : break ; } return ret ; }
\brief Convert Java keycode to native ones.
\ brief Convert Java keycode to native ones .
/* 0 - 9 */ /* A - Z */ /* F1 - F12 */ /* arrows (left, right, up, down) */