x11vnc
x11vnc copied to clipboard
Option -nomodtweak seems to cause the wrong key to be sent
Describe the bug
In both the current master and release 0.9.16, when -nomodtweak flag is enabled, the key in US English keyboard < is interpreted as >.
To Reproduce Run vnc server with the following flags:
/home/user/Programs/x11vnc-install/bin/x11vnc -quiet -repeat -nomodtweak -display :50 -bg -nopw -listen localhost -forever -autoport 5950
Connect to VNC (I use RealVNC Viewer on Windows 10), and type < key in a text editor, which will type > instead.
The issue goes away when removing the flag -nomodtweak. But that causes other problems, such as Shift not working properly anymore.
Desktop (please complete the following information):
- OS and version: Local machine is Windows 10 using RealVNC Viewer; remote machine is an Ubuntu 18.04.
- Xorg version used: X.Org X Server 1.20.4
- Wayland version used: libwayland-dev version is: 1.16.0-1ubuntu1.1~18.04.1
Additional context Note that I don't use the package manager's version of x11vnc because it crashes like crazy. I got stable behavior by compiling a version on my own.
The following is the output of running ./autogen:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for RAND_file_name in -lcrypto... yes
checking for crypt... no
checking for crypt in -lcrypt... yes
checking for OPENSSL... yes
checking how to run the C preprocessor... gcc -E
checking for X... libraries , headers
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking for XGetImage in -lX11... yes
checking for XShmGetImage in -lXext... yes
checking for XReadScreen in -lXext... no
checking for X11/extensions/readdisplay.h... no
checking for FBPMForceLevel in -lXext... no
checking for DPMSForceLevel in -lXext... yes
checking for XTestGrabControl in -lXtst... yes
checking for XTestFakeKeyEvent in -lXtst... yes
checking for XRecordEnableContextAsync in -lXtst... yes
checking for X11/XKBlib.h... yes
checking for XkbSelectEvents in -lX11... yes
checking for XineramaQueryScreens in -lXinerama... yes
checking for XRRSelectInput in -lXrandr... yes
checking for XFixesGetCursorImage in -lXfixes... yes
checking for XDamageQueryExtension in -lXdamage... yes
checking for XCompositeQueryExtension in -lXcomposite... yes
checking for XI2... yes
checking for XcursorImageLoadCursor in -lXcursor... yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking linux/videodev.h usability... no
checking linux/videodev.h presence... no
checking for linux/videodev.h... no
checking linux/fb.h usability... yes
checking linux/fb.h presence... yes
checking for linux/fb.h... yes
checking linux/input.h usability... yes
checking linux/input.h presence... yes
checking for linux/input.h... yes
checking for linux/uinput.h... yes
checking OpenGL/OpenGL.h usability... no
checking OpenGL/OpenGL.h presence... no
checking for OpenGL/OpenGL.h... no
checking for avahi... no
checking for cairo... yes
checking for LIBVNCSERVER... yes
checking for LIBVNCCLIENT... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for ANSI C header files... (cached) yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking endian.h usability... yes
checking endian.h presence... yes
checking for endian.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/endian.h usability... no
checking sys/endian.h presence... no
checking for sys/endian.h... no
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... no
checking for ws2tcpip.h... no
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking utmpx.h usability... yes
checking utmpx.h presence... yes
checking for utmpx.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/stropts.h usability... yes
checking sys/stropts.h presence... yes
checking for sys/stropts.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether byte ordering is bigendian... no
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... (cached) yes
checking for socklen_t... yes
checking for in_addr_t...
checking for working memcmp... yes
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for strftime... yes
checking for vprintf... yes
checking for _doprnt... no
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for gethostbyname in -lnsl... yes
checking for socket in -lsocket... no
checking for ftime... yes
checking for gethostbyname... (cached) yes
checking for gethostname... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for memmove... yes
checking for memset... yes
checking for mmap... yes
checking for mkfifo... yes
checking for select... yes
checking for socket... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... yes
checking for strerror... yes
checking for strstr... yes
checking for setsid... yes
checking for setpgrp... yes
checking for getpwuid... yes
checking for getpwnam... yes
checking for getspnam... yes
checking for getuid... yes
checking for geteuid... yes
checking for setuid... yes
checking for setgid... yes
checking for seteuid... yes
checking for setegid... yes
checking for initgroups... yes
checking for waitpid... yes
checking for setutxent... yes
checking for grantpt... yes
checking for shmat... (cached) yes
checking for shmget in -lcygipc... no
checking ApplicationServices/ApplicationServices.h usability... no
checking ApplicationServices/ApplicationServices.h presence... no
checking for ApplicationServices/ApplicationServices.h... no
checking android/api-level.h usability... no
checking android/api-level.h presence... no
checking for android/api-level.h... no
checking for rpm sources path... NOT-FOUND
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating misc/Makefile
config.status: creating misc/turbovnc/Makefile
config.status: creating config.h
config.status: executing depfiles commands
While the flag -xkb solves this problem, it creates the same problem that happens with nomodtweak is absent, which is that shift+F11 (in my case) doesn't work anymore.
So... if you're facing this same problem, you may wanna adopt my dumb solution (that works). I debugged x11vnc and manually forced the character codes to change.
Find my fork here where I quick-fixed this: https://github.com/TheQuantumPhysicist/x11vnc
It's definitely not the right way to do it. But I've been using x11vnc for months now with no issue.
I am experiencing this problem too on a standard US keyboard with x11vnc 0.9.16.
- x11vnc with default options, the shift key does not work for all keyboard keys
- x11vnc -noxkb, the shift key does not work for all keyboard keys
- x11vnc -nomodtweak, the shift key works for most keys except ',' which should send '<' but instead sends '>'
- x11vnc -nomodtweak -noxkb, the shift key works for most keys except ',' which should send '<' but instead sends '>'
Below is two xev logs where I to enter '<' on a real keyboard without vnc, and also via VNC. The VNC method receives the "keysym less" keycode but then actually triggers "keysym greater".
Real Keybaord
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3921957, (108,-105), root:(706,348),
state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3922411, (108,-105), root:(706,348),
state 0x11, keycode 59 (keysym 0x3c, less), same_screen YES,
XKeysymToKeycode returns keycode: 94
XLookupString gives 1 bytes: (3c) "<"
XmbLookupString gives 1 bytes: (3c) "<"
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3922592, (108,-105), root:(706,348),
state 0x11, keycode 59 (keysym 0x3c, less), same_screen YES,
XKeysymToKeycode returns keycode: 94
XLookupString gives 1 bytes: (3c) "<"
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3923036, (108,-105), root:(706,348),
state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
x11vnc with wrong keysym
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3964813, (245,-134), root:(827,306),
state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965206, (245,-134), root:(827,306),
state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965206, (245,-134), root:(827,306),
state 0x10, keycode 203 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965206, (245,-134), root:(827,306),
state 0x10, keycode 94 (keysym 0x3c, less), same_screen YES,
XLookupString gives 1 bytes: (3c) "<"
XmbLookupString gives 1 bytes: (3c) "<"
XFilterEvent returns: False
KeyPress event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965207, (245,-134), root:(827,306),
state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965207, (245,-134), root:(827,306),
state 0x11, keycode 203 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965387, (245,-134), root:(827,306),
state 0x11, keycode 94 (keysym 0x3e, greater), same_screen YES,
XKeysymToKeycode returns keycode: 60
XLookupString gives 1 bytes: (3e) ">"
XFilterEvent returns: False
KeyRelease event, serial 40, synthetic NO, window 0x4400001,
root 0x532, subw 0x0, time 3965675, (245,-134), root:(827,306),
state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
Hi, -nomodtweak fix for me, on my PT-pt keyboard, AltGr 7 , 8 , 9 and 0 problems AFAIK xkb layout now is correct so no need tweaks
I am experiencing this problem too on a standard US keyboard with x11vnc 0.9.16.
- x11vnc -nomodtweak, the shift key works for most keys except ',' which should send '<' but instead sends '>'
- x11vnc -nomodtweak -noxkb, the shift key works for most keys except ',' which should send '<' but instead sends '>'
As a dumb fix for that you can try on the remote machine:
xmodmap -e 'keycode 94= comma less comma less'
(Sorry for necroposting, but maybe someone will find it useful.)