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