Allow keycode set to be specified for the X server

This commit allows a keycode_set to be specified as a module parameter
in xrdp.ini. This has the following effects:-
1) xrdp loads the specified keycode set for mapping RDP scancodes to
   X11 keycodes. These are then passed to xorgxrdp as part of key press/
   key release events.
2) The name of the XKB rules which use the specified keycode set are
   passed to xorgxrdp so that XKB can be configured with rules which
   match the chosen keycodes.

The effect is to remove all keycode set dependencies from xorgxrdp.
Normally evdev rules and evdev keycodes will be used but base rules and
base keycodes can be used instead for applications that require them.
Also, any systems which do not ship the evdev rules can be made to
work with base rules.
This commit is contained in:
matt335672
2024-06-24 15:07:54 +01:00
parent c9a2039858
commit ba1d93930a
7 changed files with 42 additions and 2 deletions
+18
View File
@@ -175,7 +175,21 @@ lib_mod_connect(struct mod *mod)
// be set.
//
// Load the XKB layout
if (mod->keycode_set[0] != '\0')
{
if (scancode_set_keycode_set(mod->keycode_set) == 0)
{
LOG(LOG_LEVEL_INFO, "Loaded '%s' keycode set", mod->keycode_set);
}
else
{
LOG(LOG_LEVEL_WARNING, "Unable to load '%s' keycode set",
mod->keycode_set);
}
}
mod->server_init_xkb_layout(mod, &(mod->client_info));
LOG(LOG_LEVEL_INFO, "XKB rules '%s' will be used by the module",
mod->client_info.xkb_rules);
make_stream(s);
g_sprintf(con_port, "%s", mod->port);
@@ -1869,6 +1883,10 @@ lib_mod_set_param(struct mod *mod, const char *name, const char *value)
{
g_strncpy(mod->port, value, 255);
}
else if (g_strcasecmp(name, "keycode_set") == 0)
{
g_snprintf(mod->keycode_set, sizeof(mod->keycode_set), "%s", value);
}
else if (g_strcasecmp(name, "client_info") == 0)
{
g_memcpy(&(mod->client_info), value, sizeof(mod->client_info));
+1
View File
@@ -201,6 +201,7 @@ struct mod
int screen_shmem_id_mapped; /* boolean */
char *screen_shmem_pixels;
struct trans *trans;
char keycode_set[32];
};
#endif // XUP_H