src/native/globalshortcut/net_java_sip_communicator_impl_globalshortcut_NativeKeyboardHook.cc
/**
 * \brief Convert Java keycode to native ones. 
 * \param keycode Java keycode
 * \return native X11 keycode
 */
\brief Convert Java keycode to native ones.
\ brief Convert Java keycode to native ones .
static int convertJavaKeycodeToX11(int keycode)
{
    int ret = -1;
    switch(keycode)
    {
        case JVK_0:
            ret = XK_0;
            break;
        case JVK_1:
            ret = XK_1;
            break;
        case JVK_2:
            ret = XK_2;
            break;
        case JVK_3:
            ret = XK_3;
            break;
        case JVK_4:
            ret = XK_4;
            break;
        case JVK_5:
            ret = XK_5;
            break;
        case JVK_6:
            ret = XK_6;
            break;
        case JVK_7:
            ret = XK_7;
            break;
        case JVK_8:
            ret = XK_8;
            break;
        case JVK_9:
            ret = XK_9;
            break;
        case JVK_A:
            ret = XK_A;
            break;
        case JVK_B:
            ret = XK_B;
            break;
        case JVK_C:
            ret = XK_C;
            break;
        case JVK_D:
            ret = XK_D;
            break;
        case JVK_E:
            ret = XK_E;
            break;
        case JVK_F:
            ret = XK_F;
            break;
        case JVK_G:
            ret = XK_G;
            break;
        case JVK_H:
            ret = XK_H;
            break;
        case JVK_I:
            ret = XK_I;
            break;
        case JVK_J:
            ret = XK_J;
            break;
        case JVK_K:
            ret = XK_K;
            break;
        case JVK_L:
            ret = XK_L;
            break;
        case JVK_M:
            ret = XK_M;
            break;
        case JVK_N:
            ret = XK_N;
            break;
        case JVK_O:
            ret = XK_O;
            break;
        case JVK_P:
            ret = XK_P;
            break;
        case JVK_Q:
            ret = XK_Q;
            break;
        case JVK_R:
            ret = XK_R;
            break;
        case JVK_S:
            ret = XK_S;
            break;
        case JVK_T:
            ret = XK_T;
            break;
        case JVK_U:
            ret = XK_U;
            break;
        case JVK_V:
            ret = XK_V;
            break;
        case JVK_W:
            ret = XK_W;
            break;
        case JVK_X:
            ret = XK_X;
            break;
        case JVK_Y:
            ret = XK_Y;
            break;
        case JVK_Z:
            ret = XK_Z;
            break;
        case JVK_F1:
            ret = XK_F1;
            break;
        case JVK_F2:
            ret = XK_F2;
            break;
        case JVK_F3:
            ret = XK_F3;
            break;
        case JVK_F4:
            ret = XK_F4;
            break;
        case JVK_F5:
            ret = XK_F5;
            break;
        case JVK_F6:
            ret = XK_F6;
            break;
        case JVK_F7:
            ret = XK_F7;
            break;
        case JVK_F8:
            ret = XK_F8;
            break;
        case JVK_F9:
            ret = XK_F9;
            break;
        case JVK_F10:
            ret = XK_F10;
            break;
        case JVK_F11:
            ret = XK_F11;
            break;
        case JVK_F12:
            ret = XK_F12;
            break;
        case JVK_LEFT:
            ret = XK_Left;
            break;
        case JVK_RIGHT:
            ret = XK_Right;
            break;
        case JVK_UP:
            ret = XK_Up;
            break;
        case JVK_DOWN:
            ret = XK_Down;
            break;
        case JVK_COMMA:
            ret = XK_comma;
            break;
        case JVK_MINUS:
            ret = XK_minus;
            break;
        case JVK_PLUS:
            ret = XK_plus;
            break;
        case JVK_PERIOD:
            ret = XK_period;
            break;
        case JVK_SLASH:
            ret = XK_slash;
            break;
        case JVK_BACK_SLASH:
            ret = XK_backslash;
            break;
        case JVK_SEMICOLON:
            ret = XK_semicolon;
            break;
        case JVK_EQUALS:
            ret = XK_equal;
            break;
        case JVK_COLON:
            ret = XK_colon;
            break;
        case JVK_UNDERSCORE:
            ret = XK_underscore;
            break;
        case JVK_DOLLAR:
            ret = XK_dollar; 
            break;
        case JVK_EXCLAMATION_MARK:
            ret = XK_exclam;
            break;
        case JVK_GREATER:
            ret = XK_greater;
            break;
        case JVK_LESS:
            ret = XK_less;
            break;
        case JVK_QUOTE:
            ret = XK_quoteleft;
            break;
        case JVK_BACK_QUOTE:
            ret = XK_quoteright;
            break;
        case JVK_INSERT:
            ret = XK_Insert;
            break;
        case JVK_HELP:
            ret = XK_Help;
            break;
        case JVK_HOME:
            ret = XK_Home;
            break;
        case JVK_END:
            ret = XK_End;
            break;
        case JVK_PAGE_UP:
            ret = XK_Page_Up;
            break;
        case JVK_PAGE_DOWN:
            ret = XK_Page_Down;
            break;
        case JVK_OPEN_BRACKET:
            ret = XK_bracketleft;
            break;
        case JVK_CLOSE_BRACKET:
            ret = XK_bracketright;
            break;
        case JVK_LEFT_PARENTHESIS:
            ret = XK_parenleft;
            break;
        case JVK_RIGHT_PARENTHESIS:
            ret = XK_parenright;
            break;
        case 0x08:
            ret = XK_Delete;
            break;
        default:
            break;
    }
    return ret;
}
static int convertJavaKeycodeToX11 ( int keycode ) { int ret = -1 ; switch ( keycode ) { case JVK_0 : ret = XK_0 ; break ; case JVK_1 : ret = XK_1 ; break ; case JVK_2 : ret = XK_2 ; break ; case JVK_3 : ret = XK_3 ; break ; case JVK_4 : ret = XK_4 ; break ; case JVK_5 : ret = XK_5 ; break ; case JVK_6 : ret = XK_6 ; break ; case JVK_7 : ret = XK_7 ; break ; case JVK_8 : ret = XK_8 ; break ; case JVK_9 : ret = XK_9 ; break ; case JVK_A : ret = XK_A ; break ; case JVK_B : ret = XK_B ; break ; case JVK_C : ret = XK_C ; break ; case JVK_D : ret = XK_D ; break ; case JVK_E : ret = XK_E ; break ; case JVK_F : ret = XK_F ; break ; case JVK_G : ret = XK_G ; break ; case JVK_H : ret = XK_H ; break ; case JVK_I : ret = XK_I ; break ; case JVK_J : ret = XK_J ; break ; case JVK_K : ret = XK_K ; break ; case JVK_L : ret = XK_L ; break ; case JVK_M : ret = XK_M ; break ; case JVK_N : ret = XK_N ; break ; case JVK_O : ret = XK_O ; break ; case JVK_P : ret = XK_P ; break ; case JVK_Q : ret = XK_Q ; break ; case JVK_R : ret = XK_R ; break ; case JVK_S : ret = XK_S ; break ; case JVK_T : ret = XK_T ; break ; case JVK_U : ret = XK_U ; break ; case JVK_V : ret = XK_V ; break ; case JVK_W : ret = XK_W ; break ; case JVK_X : ret = XK_X ; break ; case JVK_Y : ret = XK_Y ; break ; case JVK_Z : ret = XK_Z ; break ; case JVK_F1 : ret = XK_F1 ; break ; case JVK_F2 : ret = XK_F2 ; break ; case JVK_F3 : ret = XK_F3 ; break ; case JVK_F4 : ret = XK_F4 ; break ; case JVK_F5 : ret = XK_F5 ; break ; case JVK_F6 : ret = XK_F6 ; break ; case JVK_F7 : ret = XK_F7 ; break ; case JVK_F8 : ret = XK_F8 ; break ; case JVK_F9 : ret = XK_F9 ; break ; case JVK_F10 : ret = XK_F10 ; break ; case JVK_F11 : ret = XK_F11 ; break ; case JVK_F12 : ret = XK_F12 ; break ; case JVK_LEFT : ret = XK_Left ; break ; case JVK_RIGHT : ret = XK_Right ; break ; case JVK_UP : ret = XK_Up ; break ; case JVK_DOWN : ret = XK_Down ; break ; case JVK_COMMA : ret = XK_comma ; break ; case JVK_MINUS : ret = XK_minus ; break ; case JVK_PLUS : ret = XK_plus ; break ; case JVK_PERIOD : ret = XK_period ; break ; case JVK_SLASH : ret = XK_slash ; break ; case JVK_BACK_SLASH : ret = XK_backslash ; break ; case JVK_SEMICOLON : ret = XK_semicolon ; break ; case JVK_EQUALS : ret = XK_equal ; break ; case JVK_COLON : ret = XK_colon ; break ; case JVK_UNDERSCORE : ret = XK_underscore ; break ; case JVK_DOLLAR : ret = XK_dollar ; break ; case JVK_EXCLAMATION_MARK : ret = XK_exclam ; break ; case JVK_GREATER : ret = XK_greater ; break ; case JVK_LESS : ret = XK_less ; break ; case JVK_QUOTE : ret = XK_quoteleft ; break ; case JVK_BACK_QUOTE : ret = XK_quoteright ; break ; case JVK_INSERT : ret = XK_Insert ; break ; case JVK_HELP : ret = XK_Help ; break ; case JVK_HOME : ret = XK_Home ; break ; case JVK_END : ret = XK_End ; break ; case JVK_PAGE_UP : ret = XK_Page_Up ; break ; case JVK_PAGE_DOWN : ret = XK_Page_Down ; break ; case JVK_OPEN_BRACKET : ret = XK_bracketleft ; break ; case JVK_CLOSE_BRACKET : ret = XK_bracketright ; break ; case JVK_LEFT_PARENTHESIS : ret = XK_parenleft ; break ; case JVK_RIGHT_PARENTHESIS : ret = XK_parenright ; break ; case 0x08 : ret = XK_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) */