[X2Go-Commits] [nx-libs] 28/51: nxagent: add additional keyboard config option rmlvo

git-admin at x2go.org git-admin at x2go.org
Fri Feb 8 05:40:11 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository nx-libs.

commit 161515d2463b539e8d6e6ca8db625cb6f3eece0a
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Sun Dec 2 17:08:31 2018 +0100

    nxagent: add additional keyboard config option rmlvo
    
    Add possibility to pass more than model and layout via the keyboard parameter.
---
 nx-X11/programs/Xserver/hw/nxagent/Keyboard.c    | 34 ++++++++++++++++++++----
 nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 | 11 ++++++--
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 89e51b6..d264d1c 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
 
diff --git a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1 b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
index 84669ff..938c2eb 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
+++ b/nx-X11/programs/Xserver/hw/nxagent/man/nxagent.1
@@ -603,7 +603,7 @@ start or resume a session in fullscreen mode (default: off)
 .TP 8
 .B keyboard=<string> or kbtype=<string>
 
-.BR query | clone | <model>/<layout>
+.BR query | clone | <model>/<layout> | rmlvo/<rules>#<model>#<layout>#<variant>#<options>
 
 .RS 8
 .TP 8
@@ -624,8 +624,15 @@ compatibility reasons it is not the default.
 .TP 8
 .I <model>/<layout>
 use the given model and layout. You can not modify keyboard rules,
-variant or options. Instead preset values are used. These are
+variant or options this way. Instead preset values are used. These are
 \fIbase\fR for rules and empty strings for variant and options.
+.TP 8
+.I rmlvo/<rules>#<model>#<layout>#<variant>#<options>
+configure the keyboard according to the rmlvo
+(Rules+Model+Layout+Variant+Options) description given after the / and
+separated by #. This can be used to fully pass the keyboard
+configuration of \fBnxagent\fR right after the start. Example:
+rmlvo/base#pc105#de,us#nodeadkeys#lv3:rwin_switch
 .RE
 .TP 8
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list