diff --git a/doc/FAQ.md b/doc/FAQ.md index 65500d9..c35a8dc 100755 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -5705,6 +5705,9 @@ program that will inject or otherwise process mouse and keystroke input.) Some useful -pipeinput schemes, VID, CONSOLE, and UINPUT, have since been built into x11vnc for convenience. +As of Sept/2022 UINPUTX scheme has been added to -pipeinput for better +scrolling capabilities via xinput while using uinput for keyboard keystrokes. + This non-X mode for x11vnc is somewhat experimental because it is so removed in scope from the intended usage of the tool. Incomplete attempt is made to make all of the other options consistent with non-X @@ -5926,7 +5929,9 @@ and mouse input and so it preferred when accessing graphical (e.g. Qt-embedded) linux console apps. See -pipeinput UINPUT below for more information on this mode (you may want to also use the -nodragging and -cursor none options.) Use "console0", etc or --pipeinput CONSOLE to force the /dev/ttyN method. +-pipeinput CONSOLE to force the /dev/ttyN method. Another option +if you only need keystrokes over uinput is to use +-pipeinput INPUTX and it will keep the mouse working over xinput. Note you can change VT remotely using the chvt(1) command. Sometimes switching out and back corrects the framebuffer state. diff --git a/src/help.c b/src/help.c index dacebe4..746b6b2 100644 --- a/src/help.c +++ b/src/help.c @@ -4589,6 +4589,8 @@ void print_help(int mode) { " You may also want to also use the -nodragging and\n" " -cursor none options. Use \"console0\", etc or\n" " -pipeinput CONSOLE to force the /dev/ttyN method.\n" +" If you only want keystrokes over UINPUT, but keep\n" +" your mouse over xinput then use -pipeinput UINPUTX.\n" "\n" " Note you can change the Linux VT remotely using the\n" " chvt(1) command to make the one you want be the active\n" @@ -4730,6 +4732,14 @@ void print_help(int mode) { " create it with \"mknod /dev/input/uinput c 10 223\"\n" " and insert the module with \"modprobe uinput\".\n" "\n" +" If cmd begins with \"UINPUTX\" then the Linux uinput\n" +" module is used to insert both keystroke to the \n" +" Linux console (see -rawfb above), but mouse events stay\n" +" with xinput for better scrolling. The keyboard input is\n" +" usually the /dev/input/uinput device file (you may need\n" +" to create it with \"mknod /dev/input/uinput c 10 223\"\n" +" and insert the module with \"modprobe uinput\".\n" +"\n" " The UINPUT mode currently only does US keyboards (a\n" " scan code option may be added), and not all keysyms\n" " are supported. But it is probably more accurate than\n" diff --git a/src/keyboard.c b/src/keyboard.c index 6dd161d..fb4d409 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2926,7 +2926,7 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { v4l_key_command(down, keysym, client); } else if (pipeinput_int == PIPEINPUT_CONSOLE) { console_key_command(down, keysym, client); - } else if (pipeinput_int == PIPEINPUT_UINPUT) { + } else if (pipeinput_int == PIPEINPUT_UINPUT || pipeinput_int == PIPEINPUT_UINPUTX) { uinput_key_command(down, keysym, client); } else if (pipeinput_int == PIPEINPUT_MACOSX) { macosx_key_command(down, keysym, client); diff --git a/src/params.h b/src/params.h index 6c707f1..dff2c34 100644 --- a/src/params.h +++ b/src/params.h @@ -74,6 +74,7 @@ so, delete this exception statement from your version. #define PIPEINPUT_UINPUT 0x3 #define PIPEINPUT_MACOSX 0x4 #define PIPEINPUT_VNC 0x5 +#define PIPEINPUT_UINPUTX 0x6 #define MAX_BUTTONS 7 diff --git a/src/pointer.c b/src/pointer.c index c0f6433..ad14187 100644 --- a/src/pointer.c +++ b/src/pointer.c @@ -631,6 +631,9 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) { console_pointer_command(mask, x, y, client); } else if (pipeinput_int == PIPEINPUT_UINPUT) { uinput_pointer_command(mask, x, y, client); + } else if (pipeinput_int == PIPEINPUT_UINPUTX) { + update_x11_pointer_position(x, y, client); + update_x11_pointer_mask(mask, client); } else if (pipeinput_int == PIPEINPUT_MACOSX) { macosx_pointer_command(mask, x, y, client); } else if (pipeinput_int == PIPEINPUT_VNC) { @@ -1095,6 +1098,14 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p); pipeinput_int = PIPEINPUT_UINPUT; initialize_uinput(); return; + } else if (strstr(p, "UINPUTX") == p) { + char *q = strchr(p, ':'); + if (q) { + parse_uinput_str(q+1); + } + pipeinput_int = PIPEINPUT_UINPUTX; + initialize_uinput(); + return; } else if (strstr(p, "MACOSX") == p) { pipeinput_int = PIPEINPUT_MACOSX; return; diff --git a/x11vnc.1 b/x11vnc.1 index d5497c1..3cbab50 100644 --- a/x11vnc.1 +++ b/x11vnc.1 @@ -5351,6 +5351,14 @@ is the /dev/input/uinput device file (you may need to create it with "mknod /dev/input/uinput c 10 223" and insert the module with "modprobe uinput". .IP +If cmd begins with "UINPUTX" then the Linux uinput +module is used to insert both keystroke +to the Linux console (see \fB-rawfb\fR above), but mouse events +stay with xinput for better scrolling. The keyboard input is +usually the /dev/input/uinput device file (you may need to +create it with "mknod /dev/input/uinput c 10 223" +and insert the module with "modprobe uinput". +.IP The UINPUT mode currently only does US keyboards (a scan code option may be added), and not all keysyms are supported. But it is probably more accurate than