diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-02-17 12:43:06 +0000 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2017-03-01 15:19:16 +0100 |
commit | efc0dae0519aa0ef1fabea6a64919475fd916347 (patch) | |
tree | 217c9be4c9cc9de2bc7065ed08da43863ee80416 /nx-X11/programs/Xserver/hw/nxagent/Events.c | |
parent | e70448087a05c123f916ff82f468e6d5fc57d714 (diff) | |
download | nx-libs-efc0dae0519aa0ef1fabea6a64919475fd916347.tar.gz nx-libs-efc0dae0519aa0ef1fabea6a64919475fd916347.tar.bz2 nx-libs-efc0dae0519aa0ef1fabea6a64919475fd916347.zip |
Switch from using libNX_X11's deprecated XKeycodeToKeysym() function to using XGetKeyboardMapping().
Fixes ArcticaProject/nx-libs#229.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Events.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 371780a92..efe745718 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -934,7 +934,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) { enum HandleEventResult result; - KeySym keysym; + XlibKeySym *keysym; #ifdef TEST fprintf(stderr, "nxagentDispatchEvents: Going to handle new KeyPress event.\n"); @@ -1101,12 +1101,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) * sive delay. */ - keysym = XKeycodeToKeysym(nxagentDisplay, X.xkey.keycode, 0); + int keysyms_per_keycode_return; + keysym = XGetKeyboardMapping(nxagentDisplay, + X.xkey.keycode, + 1, + &keysyms_per_keycode_return); - if (nxagentMonitoredDuplicate(keysym) == 1) + if (nxagentMonitoredDuplicate(keysym[0]) == 1) { nxagentRemoveDuplicatedKeys(&X); } + free(keysym); if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) { @@ -4638,8 +4643,16 @@ void nxagentDumpInputDevicesState(void) { if (val & (mask << k)) { + int keysyms_per_keycode_return; + XlibKeySym *keysym = XGetKeyboardMapping(nxagentDisplay, + i * 8 + k, + 1, + &keysyms_per_keycode_return); + + fprintf(stderr, "\n\t[%d] [%s]", i * 8 + k, - XKeysymToString(XKeycodeToKeysym(nxagentDisplay, i * 8 + k, 0))); + XKeysymToString(keysym[0])); + free(keysym); } } } |