diff --git a/server/internal/xorg/xorg.c b/server/internal/xorg/xorg.c index 81f7d1b..d182386 100644 --- a/server/internal/xorg/xorg.c +++ b/server/internal/xorg/xorg.c @@ -101,10 +101,20 @@ void XKey(unsigned long key, int down) { Display *display = getXDisplay(); KeyCode code = XKeysymToKeycode(display, key); - if (code != 0) { - XTestFakeKeyEvent(display, code, down, CurrentTime); - XSync(display, 0); + // Map non-existing keysyms to new keycodes + if(code == 0) { + int min, max, numcodes; + XDisplayKeycodes(display, &min, &max); + XGetKeyboardMapping(display, min, max-min, &numcodes); + + code = (max-min+1)*numcodes; + KeySym keysym_list[numcodes]; + for(int i=0;i