UINT32 freerdp_keyboard_init(UINT32 keyboardLayoutId) { UINT32 keycode; #ifdef WITH_X11 #ifdef WITH_XKBFILE keyboardLayoutId = freerdp_keyboard_init_xkbfile(keyboardLayoutId, X11_KEYCODE_TO_RDP_SCANCODE); #else keyboardLayoutId = freerdp_keyboard_init_x11(keyboardLayoutId, X11_KEYCODE_TO_RDP_SCANCODE); #endif #endif keyboardLayoutId = freerdp_detect_keyboard(keyboardLayoutId); memset(RDP_SCANCODE_TO_X11_KEYCODE, 0, sizeof(RDP_SCANCODE_TO_X11_KEYCODE)); for (keycode=0; keycode < ARRAY_SIZE(RDP_SCANCODE_TO_X11_KEYCODE); keycode++) RDP_SCANCODE_TO_X11_KEYCODE [RDP_SCANCODE_CODE(X11_KEYCODE_TO_RDP_SCANCODE[keycode])] [RDP_SCANCODE_EXTENDED(X11_KEYCODE_TO_RDP_SCANCODE[keycode]) ? 1 : 0] = keycode; return keyboardLayoutId; }
uint32 freerdp_keyboard_init(uint32 keyboardLayoutId) { uint32 keycode; #ifdef WITH_X11 #ifdef WITH_XKBFILE keyboardLayoutId = freerdp_keyboard_init_xkbfile(keyboardLayoutId, X11_KEYCODE_TO_RDP_SCANCODE); #else keyboardLayoutId = freerdp_keyboard_init_x11(keyboardLayoutId, X11_KEYCODE_TO_RDP_SCANCODE); #endif #endif keyboardLayoutId = freerdp_detect_keyboard(keyboardLayoutId); memset(RDP_SCANCODE_TO_X11_KEYCODE, 0, sizeof(RDP_SCANCODE_TO_X11_KEYCODE)); for (keycode=0; keycode < ARRAY_SIZE(RDP_SCANCODE_TO_X11_KEYCODE); keycode++) RDP_SCANCODE_TO_X11_KEYCODE [rdp_scancode_code(X11_KEYCODE_TO_RDP_SCANCODE[keycode])] [rdp_scancode_extended(X11_KEYCODE_TO_RDP_SCANCODE[keycode]) ? 1 : 0] = keycode; return keyboardLayoutId; }