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