aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-11-26 08:35:55 +0100
committerMihai Moldovan <ionic@ionic.de>2017-11-26 08:35:55 +0100
commit7f777e01e3bb8780ba91e70171a0aae78a95692e (patch)
treed7f160a956061a73d8636a1cf53078464ce2bf2e /nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
parent2e724702e004abf5df1061dd799c9349edc2b099 (diff)
parent66046f138cf816d4f0bd7ddd9faac772acb22a97 (diff)
downloadnx-libs-7f777e01e3bb8780ba91e70171a0aae78a95692e.tar.gz
nx-libs-7f777e01e3bb8780ba91e70171a0aae78a95692e.tar.bz2
nx-libs-7f777e01e3bb8780ba91e70171a0aae78a95692e.zip
Merge branch 'uli42-pr/nokeyconv' into 3.6.x
Attributes GH PR #556: https://github.com/ArcticaProject/nx-libs/pull/556
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Keyboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 02b60bef4..51f57a897 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 Bool nxagentKeycodeConversion = False;
CARD8 nxagentConvertKeycode(CARD8 k)
{
- if (nxagentKeycodeConversion != 0)
+ if (nxagentKeycodeConversion)
{
#ifdef DEBUG
if (k != nxagentConvertedKeycodes[k])
@@ -1821,7 +1821,20 @@ void nxagentKeycodeConversionSetup(void)
char *doptions = NULL;
unsigned int drulesLen;
- nxagentKeycodeConversion = 0;
+ 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,
&dvariant, &doptions);
@@ -1894,7 +1907,12 @@ void nxagentKeycodeConversionSetup(void)
"Activating KeyCode conversion.\n");
#endif
- nxagentKeycodeConversion = 1;
+ 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)
@@ -1923,7 +1941,7 @@ void nxagentResetKeycodeConversion(void)
"WARNING! Failed to query XKB extension.\n");
#endif
- nxagentKeycodeConversion = 0;
+ nxagentKeycodeConversion = False;
}
}