xfreerdp: add -k keyboard layout option

This commit is contained in:
Marc-André Moreau 2011-08-25 21:35:51 -04:00
parent ccc084981e
commit 6b732af29b
3 changed files with 27 additions and 4 deletions

View File

@ -32,6 +32,7 @@
void xf_kbd_init(xfInfo* xfi)
{
memset(xfi->pressed_keys, 0, 256 * sizeof(boolean));
xfi->keyboard_layout_id = xfi->instance->settings->kbd_layout;
xfi->keyboard_layout_id = freerdp_kbd_init(xfi->display, xfi->keyboard_layout_id);
xfi->instance->settings->kbd_layout = xfi->keyboard_layout_id;
}

View File

@ -613,10 +613,22 @@ void rdp_read_input_capability_set(STREAM* s, rdpSettings* settings)
stream_read_uint16(s, inputFlags); /* inputFlags (2 bytes) */
stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
stream_read_uint32(s, settings->kbd_layout); /* keyboardLayout (4 bytes) */
stream_read_uint32(s, settings->kbd_type); /* keyboardType (4 bytes) */
stream_read_uint32(s, settings->kbd_subtype); /* keyboardSubType (4 bytes) */
stream_read_uint32(s, settings->kbd_fn_keys); /* keyboardFunctionKeys (4 bytes) */
if (settings->server_mode)
{
stream_read_uint32(s, settings->kbd_layout); /* keyboardLayout (4 bytes) */
stream_read_uint32(s, settings->kbd_type); /* keyboardType (4 bytes) */
stream_read_uint32(s, settings->kbd_subtype); /* keyboardSubType (4 bytes) */
stream_read_uint32(s, settings->kbd_fn_keys); /* keyboardFunctionKeys (4 bytes) */
}
else
{
stream_seek_uint32(s); /* keyboardLayout (4 bytes) */
stream_seek_uint32(s); /* keyboardType (4 bytes) */
stream_seek_uint32(s); /* keyboardSubType (4 bytes) */
stream_seek_uint32(s); /* keyboardFunctionKeys (4 bytes) */
}
stream_seek(s, 64); /* imeFileName (64 bytes) */
if ((inputFlags & INPUT_FLAG_FASTPATH_INPUT) == 0 && (inputFlags & INPUT_FLAG_FASTPATH_INPUT2) == 0)

View File

@ -165,6 +165,16 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
}
settings->port = atoi(argv[index]);
}
else if (strcmp("-k", argv[index]) == 0)
{
index++;
if (index == argc)
{
printf("missing keyboard layout id\n");
return -1;
}
sscanf(argv[index], "%X", &(settings->kbd_layout));
}
else if (strcmp("-n", argv[index]) == 0)
{
index++;