From 4b71309c3e727bf1770e8150546060a450246f24 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 19 Nov 2017 01:07:57 +0100 Subject: Keyboard.c: Use booleans for nxagentKeycodeConversion --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 02b60bef4..06977d99d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -475,11 +475,11 @@ static CARD8 nxagentConvertedKeycodes[] = /* 255 */ 255 }; -static int nxagentKeycodeConversion = 0; +static int nxagentKeycodeConversion = False; CARD8 nxagentConvertKeycode(CARD8 k) { - if (nxagentKeycodeConversion != 0) + if (nxagentKeycodeConversion) { #ifdef DEBUG if (k != nxagentConvertedKeycodes[k]) @@ -1821,7 +1821,7 @@ void nxagentKeycodeConversionSetup(void) char *doptions = NULL; unsigned int drulesLen; - nxagentKeycodeConversion = 0; + nxagentKeycodeConversion = False; drulesLen = nxagentXkbGetNames(&drules, &dmodel, &dlayout, &dvariant, &doptions); @@ -1894,7 +1894,7 @@ void nxagentKeycodeConversionSetup(void) "Activating KeyCode conversion.\n"); #endif - nxagentKeycodeConversion = 1; + nxagentKeycodeConversion = True; } if (drules != NULL) @@ -1923,7 +1923,7 @@ void nxagentResetKeycodeConversion(void) "WARNING! Failed to query XKB extension.\n"); #endif - nxagentKeycodeConversion = 0; + nxagentKeycodeConversion = False; } } -- cgit v1.2.3 From 8fd25cf83c057e9d865b672eb3d42e2d362eabd7 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sun, 19 Nov 2017 01:11:05 +0100 Subject: add option keyconv=(auto|on|off) Adds a new option called "keyconv" to control keycode conversion. Before commit 2f2ade61a8823bad012737b2b388dcc168cccbbf keycode conversion was activated if the client was Linux and client side rules and/or model was "evdev". The only (and undocumented) way to disable that was providing a value different from "linux" for the "client" option (which had no other effect). The mentioned commit removed the dependency on Linux and so there was no way anymore to disable keycode conversion. --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 06977d99d..e92df8762 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1821,6 +1821,19 @@ void nxagentKeycodeConversionSetup(void) char *doptions = NULL; unsigned int drulesLen; + if (nxagentOption(KeycodeConversion) == KeycodeConversionOff) + { + fprintf(stderr, "Info: Keycode conversion is off\n"); + nxagentKeycodeConversion = False; + return; + } + else if (nxagentOption(KeycodeConversion) == KeycodeConversionOn) + { + fprintf(stderr, "Info: Keycode conversion is on\n"); + nxagentKeycodeConversion = True; + return; + } + nxagentKeycodeConversion = False; drulesLen = nxagentXkbGetNames(&drules, &dmodel, &dlayout, @@ -1894,8 +1907,13 @@ void nxagentKeycodeConversionSetup(void) "Activating KeyCode conversion.\n"); #endif + fprintf(stderr, "Info: Keycode conversion auto-determined as on\n"); nxagentKeycodeConversion = True; } + else + { + fprintf(stderr, "Info: Keycode conversion auto-determined as off\n"); + } if (drules != NULL) { -- cgit v1.2.3 From 66046f138cf816d4f0bd7ddd9faac772acb22a97 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 23 Nov 2017 15:19:02 +0100 Subject: Keyboard.c: make nxagentKeycodeConversion a Boolean --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index e92df8762..51f57a897 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -475,7 +475,7 @@ static CARD8 nxagentConvertedKeycodes[] = /* 255 */ 255 }; -static int nxagentKeycodeConversion = False; +static Bool nxagentKeycodeConversion = False; CARD8 nxagentConvertKeycode(CARD8 k) { -- cgit v1.2.3