aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2018-12-02 17:08:31 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-12-19 12:32:03 +0100
commit161515d2463b539e8d6e6ca8db625cb6f3eece0a (patch)
tree763fd358de1d067427089bd66652cf99af9ac193 /nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
parent1de6ca599f6f410308c7fe2ddd700197f66662fd (diff)
downloadnx-libs-161515d2463b539e8d6e6ca8db625cb6f3eece0a.tar.gz
nx-libs-161515d2463b539e8d6e6ca8db625cb6f3eece0a.tar.bz2
nx-libs-161515d2463b539e8d6e6ca8db625cb6f3eece0a.zip
nxagent: add additional keyboard config option rmlvo
Add possibility to pass more than model and layout via the keyboard parameter.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 89e51b628..d264d1c96 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -774,8 +774,33 @@ XkbError:
goto XkbError;
}
- model = strndup(nxagentKeyboard, i);
- layout = strdup(&nxagentKeyboard[i + 1]);
+ /*
+ The original nxagent only supports model/layout values
+ here. It uses these values together with the default rules
+ and empty variant and options. We use a more or less
+ compatible hack here: The special keyword rlmvo for model
+ means that the layout part of the string will contain a
+ full RMLVO config, separated by #, e.g.
+ rlmvo/base#pc105#de,us#nodeadkeys#lv3:rwin_switch
+ */
+ if (strncmp(nxagentKeyboard, "rlmvo/", 6) == 0)
+ {
+ const char * sep = "#";
+ char * rmlvo = strdup(&nxagentKeyboard[i+1]);
+ char * tmp = rmlvo;
+ /* strtok cannot handle empty fields, so use strsep */
+ rules = strdup(strsep(&tmp, sep));
+ model = strdup(strsep(&tmp, sep));
+ layout = strdup(strsep(&tmp, sep));
+ variant = strdup(strsep(&tmp, sep));
+ options = strdup(strsep(&tmp, sep));
+ free(rmlvo);
+ }
+ else
+ {
+ model = strndup(nxagentKeyboard, i);
+ layout = strdup(&nxagentKeyboard[i + 1]);
+ }
/*
* There is no description for pc105 on Solaris.
@@ -783,8 +808,8 @@ XkbError:
*/
#ifdef TEST
- fprintf(stderr, "nxagentKeyboardProc: Using keyboard model [%s] with layout [%s].\n",
- model, layout);
+ fprintf(stderr, "%s: Using [rules='%s',model='%s',layout='%s',variant='%s',options='%s'].\n",
+ __func__, rules, model, layout, variant, options);
#endif
#ifdef __sun
@@ -793,7 +818,6 @@ XkbError:
{
#ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: WARNING! Keyboard model 'pc105' unsupported on Solaris.\n");
-
fprintf(stderr, "nxagentKeyboardProc: WARNING! Forcing keyboard model to 'pc104'.\n");
#endif