x11vnc: add uinput support for full input into linux fb device (e.g. qt-embed).

pull/1/head
runge 18 years ago
parent 8cda60969b
commit 079528470d

@ -1,3 +1,6 @@
2006-07-08 Karl Runge <runge@karlrunge.com>
* configure.ac: add <linux/uinput.h> for linux console.
2006-07-04 Karl Runge <runge@karlrunge.com> 2006-07-04 Karl Runge <runge@karlrunge.com>
* configure.ac: add getspnam. * configure.ac: add getspnam.

@ -62,6 +62,8 @@ AH_TEMPLATE(HAVE_IRIX_XREADDISPLAY, [IRIX XReadDisplay available])
AH_TEMPLATE(HAVE_FBPM, [FBPM extension build environment present]) AH_TEMPLATE(HAVE_FBPM, [FBPM extension build environment present])
AH_TEMPLATE(HAVE_LINUX_VIDEODEV_H, [video4linux build environment present]) AH_TEMPLATE(HAVE_LINUX_VIDEODEV_H, [video4linux build environment present])
AH_TEMPLATE(HAVE_LINUX_FB_H, [linux fb device build environment present]) AH_TEMPLATE(HAVE_LINUX_FB_H, [linux fb device build environment present])
AH_TEMPLATE(HAVE_LINUX_INPUT_H, [linux/input.h present])
AH_TEMPLATE(HAVE_LINUX_UINPUT_H, [linux uinput device build environment present])
AC_ARG_WITH(xkeyboard, AC_ARG_WITH(xkeyboard,
[ --without-xkeyboard disable xkeyboard extension support],,) [ --without-xkeyboard disable xkeyboard extension support],,)
@ -83,6 +85,8 @@ AC_ARG_WITH(v4l,
[ --without-v4l disable video4linux support],,) [ --without-v4l disable video4linux support],,)
AC_ARG_WITH(fbdev, AC_ARG_WITH(fbdev,
[ --without-fbdev disable linux fb device support],,) [ --without-fbdev disable linux fb device support],,)
AC_ARG_WITH(uinput,
[ --without-uinput disable linux uinput device support],,)
if test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then if test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
AC_CHECK_LIB(X11, XGetImage, HAVE_X="true", AC_CHECK_LIB(X11, XGetImage, HAVE_X="true",
@ -237,6 +241,14 @@ if test "$X_CFLAGS" != "-DX_DISPLAY_MISSING"; then
AC_CHECK_HEADER(linux/fb.h, AC_CHECK_HEADER(linux/fb.h,
[AC_DEFINE(HAVE_LINUX_FB_H)],,) [AC_DEFINE(HAVE_LINUX_FB_H)],,)
fi fi
if test "x$with_uinput" != "xno"; then
AC_CHECK_HEADER(linux/input.h,
[AC_DEFINE(HAVE_LINUX_INPUT_H) HAVE_LINUX_INPUT_H="true"],,)
if test "x$HAVE_LINUX_INPUT_H" = "xtrue"; then
AC_CHECK_HEADER(linux/uinput.h,
[AC_DEFINE(HAVE_LINUX_UINPUT_H)],, [#include <linux/input.h>])
fi
fi
X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS" X_LIBS="$X_LIBS $X_PRELIBS -lX11 $X_EXTRA_LIBS"
fi fi

@ -1,3 +1,8 @@
2006-07-08 Karl Runge <runge@karlrunge.com>
* x11vnc: add uinput support (-pipeinput UINPUT:...) for full
mouse and key input to linux console (e.g. for qt-embedded apps)
add -allinput for handleEventsEagerly.
2006-07-04 Karl Runge <runge@karlrunge.com> 2006-07-04 Karl Runge <runge@karlrunge.com>
* x11vnc: 2nd -accept popup with WAIT, and UNIX: info for unixpw * x11vnc: 2nd -accept popup with WAIT, and UNIX: info for unixpw
login. Use RFB_CLIENT_ON_HOLD for -unixpw. -unixpw white arrow login. Use RFB_CLIENT_ON_HOLD for -unixpw. -unixpw white arrow

@ -13,7 +13,7 @@ endif
if HAVE_X if HAVE_X
bin_PROGRAMS=x11vnc bin_PROGRAMS=x11vnc
x11vnc_SOURCES = 8to24.c cleanup.c connections.c cursor.c gui.c help.c inet.c keyboard.c linuxfb.c options.c pm.c pointer.c rates.c remote.c scan.c screen.c selection.c solid.c sslcmds.c sslhelper.c unixpw.c user.c userinput.c util.c v4l.c win_utils.c x11vnc.c x11vnc_defs.c xdamage.c xevents.c xinerama.c xkb_bell.c xrandr.c xrecord.c xwrappers.c 8to24.h allowed_input_t.h blackout_t.h cleanup.h connections.h cursor.h enums.h gui.h help.h inet.h keyboard.h linuxfb.h options.h params.h pm.h pointer.h rates.h remote.h scan.h screen.h scrollevent_t.h selection.h solid.h sslcmds.h sslhelper.h ssltools.h tkx11vnc.h unixpw.h user.h userinput.h util.h v4l.h win_utils.h winattr_t.h x11vnc.h xdamage.h xevents.h xinerama.h xkb_bell.h xrandr.h xrecord.h xwrappers.h x11vnc_SOURCES = 8to24.c cleanup.c connections.c cursor.c gui.c help.c inet.c keyboard.c linuxfb.c options.c pm.c pointer.c rates.c remote.c scan.c screen.c selection.c solid.c sslcmds.c sslhelper.c uinput.c unixpw.c user.c userinput.c util.c v4l.c win_utils.c x11vnc.c x11vnc_defs.c xdamage.c xevents.c xinerama.c xkb_bell.c xrandr.c xrecord.c xwrappers.c 8to24.h allowed_input_t.h blackout_t.h cleanup.h connections.h cursor.h enums.h gui.h help.h inet.h keyboard.h linuxfb.h options.h params.h pm.h pointer.h rates.h remote.h scan.h screen.h scrollevent_t.h selection.h solid.h sslcmds.h sslhelper.h ssltools.h tkx11vnc.h uinput.h unixpw.h user.h userinput.h util.h v4l.h win_utils.h winattr_t.h x11vnc.h xdamage.h xevents.h xinerama.h xkb_bell.h xrandr.h xrecord.h xwrappers.h
INCLUDES=@X_CFLAGS@ INCLUDES=@X_CFLAGS@
x11vnc_LDADD=$(LDADD) @X_LIBS@ $(LD_CYGIPC) x11vnc_LDADD=$(LDADD) @X_LIBS@ $(LD_CYGIPC)
endif endif

@ -1,5 +1,5 @@
x11vnc README file Date: Tue Jul 4 19:57:31 EDT 2006 x11vnc README file Date: Sat Jul 8 19:22:13 EDT 2006
The following information is taken from these URLs: The following information is taken from these URLs:
@ -7196,7 +7196,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options: Here are all of x11vnc command line options:
% x11vnc -opts (see below for -help long descriptions) % x11vnc -opts (see below for -help long descriptions)
x11vnc: allow VNC connections to real X11 displays. 0.8.2 lastmod: 2006-07-04 x11vnc: allow VNC connections to real X11 displays. 0.8.2 lastmod: 2006-07-08
x11vnc options: x11vnc options:
-display disp -auth file -id windowid -display disp -auth file -id windowid
@ -7246,21 +7246,21 @@ x11vnc options:
-fixscreen string -debug_scroll -noxrecord -fixscreen string -debug_scroll -noxrecord
-grab_buster -nograb_buster -debug_grabs -grab_buster -nograb_buster -debug_grabs
-debug_sel -pointer_mode n -input_skip n -debug_sel -pointer_mode n -input_skip n
-speeds rd,bw,lat -wmdt string -debug_pointer -allinput -speeds rd,bw,lat -wmdt string
-debug_keyboard -defer time -wait time -debug_pointer -debug_keyboard -defer time
-wait_ui factor -nowait_bog -slow_fb time -wait time -wait_ui factor -nowait_bog
-readtimeout n -nap -nonap -slow_fb time -readtimeout n -nap
-sb time -nofbpm -fbpm -nonap -sb time -nofbpm
-noxdamage -xd_area A -xd_mem f -fbpm -noxdamage -xd_area A
-sigpipe string -threads -nothreads -xd_mem f -sigpipe string -threads
-fs f -gaps n -grow n -nothreads -fs f -gaps n
-fuzz n -debug_tiles -snapfb -grow n -fuzz n -debug_tiles
-rawfb string -freqtab file -pipeinput cmd -snapfb -rawfb string -freqtab file
-gui [gui-opts] -remote command -query variable -pipeinput cmd -gui [gui-opts] -remote command
-QD variable -sync -noremote -query variable -QD variable -sync
-yesremote -unsafe -safer -noremote -yesremote -unsafe
-privremote -nocmds -allowedcmds list -safer -privremote -nocmds
-deny_all -allowedcmds list -deny_all
libvncserver options: libvncserver options:
-rfbport port TCP port for RFB protocol -rfbport port TCP port for RFB protocol
@ -7294,7 +7294,7 @@ libvncserver-tight-extension options:
% x11vnc -help % x11vnc -help
x11vnc: allow VNC connections to real X11 displays. 0.8.2 lastmod: 2006-07-04 x11vnc: allow VNC connections to real X11 displays. 0.8.2 lastmod: 2006-07-08
(type "x11vnc -opts" to just list the options.) (type "x11vnc -opts" to just list the options.)
@ -9457,6 +9457,9 @@ Options:
means to act as though there is always user input. means to act as though there is always user input.
Default: 10 Default: 10
-allinput Have x11vnc read and process all available client input
before proceeding.
-speeds rd,bw,lat x11vnc tries to estimate some speed parameters that -speeds rd,bw,lat x11vnc tries to estimate some speed parameters that
are used to optimize scheduling (e.g. -pointer_mode are used to optimize scheduling (e.g. -pointer_mode
4, -wireframe, -scrollcopyrect) and other things. 4, -wireframe, -scrollcopyrect) and other things.
@ -9613,13 +9616,19 @@ Options:
For shared memory segments string is of the For shared memory segments string is of the
form: "shm:N@WxHxB" which specifies a shmid form: "shm:N@WxHxB" which specifies a shmid
N and framebuffer Width, Height, and Bits N and framebuffer Width, Height, and Bits
per pixel. To memory map mmap(2) a file use: per pixel.
"map:/path/to/a/file@WxHxB". If there is trouble
with mmap, use "file:/..." for slower lseek(2) based For file polling to memory map mmap(2) a file use:
reading. Use "snap:..." to imply -snapfb mode and the "map:/path/to/a/file@WxHxB", with WxHxB as above.
"file:" access (this is for devices that only provide "mmap:..." is the same. If there is trouble with mmap,
the fb all at once). If you do not supply a type "map" use "file:/..." for slower lseek(2) based reading.
is assumed if the file exists. Use "snap:..." to imply -snapfb mode and the "file:"
access (this is for devices that only provide the fb
all at once).
If you do not supply a type "map" is assumed if
the file exists (see the next paragraphs for some
exceptions to this.)
If string is "setup:cmd", then the command "cmd" If string is "setup:cmd", then the command "cmd"
is run and the first line from it is read and used is run and the first line from it is read and used
@ -9627,13 +9636,14 @@ Options:
determining WxHxB, etc. These are often done as root determining WxHxB, etc. These are often done as root
so take care. so take care.
If the string begins with "video", see the video4linux If the string begins with "video", see the VIDEO4LINUX
discusion below where the device may be queried for discusion below where the device may be queried for
(and possibly set) the framebuffer parameters. (and possibly set) the framebuffer parameters.
If the strings begins with "cons", see the linux If the string begins with "cons", "/dev/fb", or
console discussion below where the framebuffer device "fb", see the LINUX CONSOLE discussion below where
is opened and keystrokes are inserted into the console. the framebuffer device is opened and keystrokes (and
possibly mouse events) are inserted into the console.
Optional suffixes are ":R/G/B" and "+O" to specify Optional suffixes are ":R/G/B" and "+O" to specify
red, green, and blue masks and an offset into the red, green, and blue masks and an offset into the
@ -9653,11 +9663,12 @@ Options:
(see ipcs(1) and fbset(1) for the first two examples) (see ipcs(1) and fbset(1) for the first two examples)
All user input is discarded by default (but see the In general all user input is discarded by default (see
-pipeinput option). Most of the X11 (screen, keyboard, the -pipeinput option for how to use a helper program
mouse) options do not make sense and many will cause to insert). Most of the X11 (screen, keyboard, mouse)
this mode to crash, so please think twice before options do not make sense and many will cause this
setting or changing them in a running x11vnc. mode to crash, so please think twice before setting or
changing them in a running x11vnc.
If you DO NOT want x11vnc to close the X DISPLAY in If you DO NOT want x11vnc to close the X DISPLAY in
rawfb mode, prepend a "+" e.g. +file:/dev/fb0... rawfb mode, prepend a "+" e.g. +file:/dev/fb0...
@ -9676,13 +9687,13 @@ Options:
SNAPFB_RAWFB_RESET=1 as well. SNAPFB_RAWFB_RESET=1 as well.
If you want x11vnc to dynamically transform a 24bpp If you want x11vnc to dynamically transform a 24bpp
rawfb to 32bpp (note that this will be slower) use rawfb to 32bpp (note that this will be slower) also
the -24to32 option. This would be useful for, say, supply the -24to32 option. This would be useful for,
for a video camera that delivers the pixel data as say, a video camera that delivers the pixel data as
24bpp packed RGB. This is the default under "video" 24bpp packed RGB. This is the default under "video"
mode if the bpp is 24. mode if the bpp is 24.
video4linux: on Linux some attempt is made to handle VIDEO4LINUX: on Linux some attempt is made to handle
video devices (webcams or TV tuners) automatically. video devices (webcams or TV tuners) automatically.
The idea is the WxHxB will be extracted from the The idea is the WxHxB will be extracted from the
device itself. So if you do not supply "@WxHxB... device itself. So if you do not supply "@WxHxB...
@ -9760,44 +9771,63 @@ Options:
See the -pipeinput VID option below for a way to control See the -pipeinput VID option below for a way to control
the settings through the VNC Viewer via keystrokes. the settings through the VNC Viewer via keystrokes.
As a shortcut, if the string begins "Video.." instead
of "video.." then -pipeinput VID is implied.
As above, if you specify a "@WxHxB..." after the As above, if you specify a "@WxHxB..." after the
<settings> string they are used verbatim: the device <settings> string they are used verbatim: the device
is not queried for the current values. Otherwise the is not queried for the current values. Otherwise the
device will be queried. device will be queried.
Linux console: If the libvncserver LinuxVNC command is LINUX CONSOLE: If the libvncserver LinuxVNC program
on your system use that instead of the following method is on your system you may want to use that instead of
because it will be faster and more accurate for Linux the following method because it will be faster and more
text console. accurate for Linux text console.
If the rawfb string begins with "cons" the framebuffer If the rawfb string begins with "cons" the framebuffer
device /dev/fb0 is opened (this requires the appropriate device /dev/fb0 is opened (this requires the appropriate
kernel modules) and so is /dev/tty0. The latter is kernel modules to be installed) and so is /dev/tty0.
used to inject keystrokes (not all are supported, The latter is used to inject keystrokes (not all are
but the basic ones are). You will need to be root to supported, but the basic ones are). You will need to
inject keystrokes. /dev/tty0 refers to the active VT, be root to inject keystrokes. /dev/tty0 refers to the
to indicate one explicitly, use "cons2", etc. using active VT, to indicate one explicitly, use "cons2",
the VT number. Note you can change VT remotely using etc. using the VT number.
the chvt(1) command. Sometimes switching out and back
corrects the framebuffer. To skip injecting entirely If the Linux version seems to be 2.6 or later and the
use "consx". "uinput" module appears to be present, then the uinput
method will be used instead of /dev/ttyN. uinput allows
insertion of BOTH keystrokes 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 "cons0", etc or -pipeinput CONS to force the
/dev/ttyN method.
Note you can change VT remotely using the chvt(1)
command. Sometimes switching out and back corrects
the framebuffer state.
To skip input injecting entirely use "consx".
The strings "console", or "/dev/fb0" can be used The strings "console", or "/dev/fb0" can be used
instead of "cons". The latter can be used to specify instead of "cons". The latter can be used to specify
a different framebuffer device, e.g. /dev/fb1. If the a different framebuffer device, e.g. /dev/fb1. As a
name is something nonstandard, use "cons:/dev/foofb" shortcut the "/dev/" can be dropped. If the name is
something nonstandard, use "cons:/dev/foofb"
If you do not want x11vnc to guess the framebuffer's If you do not want x11vnc to guess the framebuffer's
WxHxB and masks automatically, specify them with a WxHxB and masks automatically (sometimes the kernel
given inaccurate information), specify them with a
@WxHxB at the end of the string. @WxHxB at the end of the string.
Examples: Examples:
-rawfb cons (same as -rawfb console) -rawfb cons (same as -rawfb console)
-rawfb /dev/fb0 (same) -rawfb /dev/fb0 (same)
-rawfb cons3 (force /dev/tty3) -rawfb cons3 (force /dev/tty3)
-rawfb consx (no keystrokes) -rawfb consx (no keystrokes or mouse)
-rawfb console:/dev/nonstd -rawfb console:/dev/nonstd
-rawfb cons -pipeinput UINPUT:accel=1.5
-freqtab file For use with "-rawfb video" for TV tuner devices to -freqtab file For use with "-rawfb video" for TV tuner devices to
specify station frequencies. Instead of using the built specify station frequencies. Instead of using the built
@ -9826,6 +9856,8 @@ Options:
value is stored in X11VNC_RAWFB_STR for the pipe command value is stored in X11VNC_RAWFB_STR for the pipe command
to use if it wants. Do 'env | grep X11VNC' for more. to use if it wants. Do 'env | grep X11VNC' for more.
Built-in pipeinput modes:
If cmd is "VID" and you are using the -rawfb for a If cmd is "VID" and you are using the -rawfb for a
video capture device, then an internal list of keyboard video capture device, then an internal list of keyboard
mappings is used to set parameters of the video. mappings is used to set parameters of the video.
@ -9844,7 +9876,57 @@ Options:
If cmd is "CONS" or "CONSn" where n is a Linux If cmd is "CONS" or "CONSn" where n is a Linux
console number, then the linux console keystroke console number, then the linux console keystroke
insertion (see -rawfb cons) is performed. insertion to /dev/ttyN (see -rawfb cons) is performed.
If cmd begins with "UINPUT" then the Linux uinput
module is used to insert both keystroke and mouse events
to the Linux console (see -rawfb above). This usually
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".
The UINPUT mode currently only does US keyboards (a
scan code option may be added), and not all keysyms
are supported.
You may want to use the options -cursor none and
-nodragging in this mode.
Additional tuning options may be supplied via:
UINPUT:opt1,opt2,... (a comma separated list). If an
option begins with "/" it is taken as the uinput
device file.
Which uinput is injected can be controlled by an option
string made of the characters "K", "M", and "B"
(see the -input option), e.g. "KM" allows keystroke
and motion but not button clicks.
A UINPUT option of the form: accel=f, or accel=fx+fy
sets the mouse motion "acceleration". This is used
to correct raw mouse relative motion into how much the
application cursor moves (x11vnc has no control over
how the application interprets the raw mouse motions).
Typically the acceleration for an X display is 2 (see
xset "m" option). "f" is a floating point number,
e.g. 2.0. Use "fx+fy" if you need to supply different
corrections for x and y.
Note: the default acceleration is 2.0 since it seems
both X and qt-embedded often use this value.
Even with a correct accel setting the mouse position
will get out of sync (probably due to a mouse
"threshold" setting where the acceleration doe not
apply, set xset(1)). The option reset=N sets the number
of ms (default 500) after which the cursor is attempted
to be reset (by forcing the mouse to (0, 0) via small
increments and then back out to (x, y) in 1 jump), This
correction seems to be needed but can cause jerkiness
or unexpected behavior. Use reset=0 to disable.
Example:
-pipeinput UINPUT:accel=1.0 -cursor none
-gui [gui-opts] Start up a simple tcl/tk gui based on the the remote -gui [gui-opts] Start up a simple tcl/tk gui based on the the remote
control options -remote/-query described below. control options -remote/-query described below.
@ -10166,6 +10248,8 @@ n
reset_record reset RECORD extension (if avail.) reset_record reset RECORD extension (if avail.)
pointer_mode:n set -pointer_mode to n. same as "pm" pointer_mode:n set -pointer_mode to n. same as "pm"
input_skip:n set -input_skip to n. input_skip:n set -input_skip to n.
allinput enable use of -allinput mode.
noallinput disable use of -allinput mode.
speeds:str set -speeds to str. speeds:str set -speeds to str.
wmdt:str set -wmdt to str. wmdt:str set -wmdt to str.
debug_pointer enable -debug_pointer, same as "dp" debug_pointer enable -debug_pointer, same as "dp"
@ -10195,6 +10279,8 @@ n
snapfb enable -snapfb mode. snapfb enable -snapfb mode.
nosnapfb disable -snapfb mode. nosnapfb disable -snapfb mode.
rawfb:str set -rawfb mode to "str". rawfb:str set -rawfb mode to "str".
uinput_accel:f set uinput_accel to f.
uinput_reset:n set uinput_reset to n ms.
progressive:n set libvncserver -progressive slice progressive:n set libvncserver -progressive slice
height parameter to n. height parameter to n.
desktop:str set -desktop name to str for new clients desktop:str set -desktop name to str for new clients
@ -10268,7 +10354,6 @@ n
remote command, we hope the name makes it obvious what remote command, we hope the name makes it obvious what
the returned value corresponds to (hint: the ext_* the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions): variables correspond to the presence of X extensions):
ans= stop quit exit shutdown ping blacken zero ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid waitmapped refresh reset close disconnect id sid waitmapped
nowaitmapped clip flashcmap noflashcmap shiftcmap nowaitmapped clip flashcmap noflashcmap shiftcmap
@ -10299,16 +10384,17 @@ n
nodragging wireframe_mode wireframe wf nowireframe nodragging wireframe_mode wireframe wf nowireframe
nowf wirecopyrect wcr nowirecopyrect nowcr scr_area nowf wirecopyrect wcr nowirecopyrect nowcr scr_area
scr_skip scr_inc scr_keys scr_term scr_keyrepeat scr_skip scr_inc scr_keys scr_term scr_keyrepeat
scr_parms scrollcopyrect scr noscrollcopyrect noscr scr_parms scrollcopyrect scr noscrollcopyrect
fixscreen noxrecord xrecord reset_record pointer_mode noscr fixscreen noxrecord xrecord reset_record
pm input_skip input grabkbd nograbkbd grabptr pointer_mode pm input_skip allinput noallinput input
nograbptr client_input speeds wmdt debug_pointer dp grabkbd nograbkbd grabptr nograbptr client_input
nodebug_pointer nodp debug_keyboard dk nodebug_keyboard speeds wmdt debug_pointer dp nodebug_pointer nodp
nodk deferupdate defer wait_ui wait_bog nowait_bog debug_keyboard dk nodebug_keyboard nodk deferupdate
slow_fb wait readtimeout nap nonap sb screen_blank defer wait_ui wait_bog nowait_bog slow_fb wait
fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb readtimeout nap nonap sb screen_blank fbpm nofbpm
progressive rfbport http nohttp httpport httpdir fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel
enablehttpproxy noenablehttpproxy alwaysshared uinput_reset progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage debug_xevents debug_xdamage nodebug_xdamage
@ -10333,7 +10419,6 @@ n
mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y
wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y
rfbauth passwd viewpasswd rfbauth passwd viewpasswd
-QD variable Just like -query variable, but returns the default -QD variable Just like -query variable, but returns the default
value for that parameter (no running x11vnc server value for that parameter (no running x11vnc server
is consulted) is consulted)

@ -2192,6 +2192,9 @@ void print_help(int mode) {
" means to act as though there is always user input.\n" " means to act as though there is always user input.\n"
" Default: %d\n" " Default: %d\n"
"\n" "\n"
"-allinput Have x11vnc read and process all available client input\n"
" before proceeding.\n"
"\n"
"-speeds rd,bw,lat x11vnc tries to estimate some speed parameters that\n" "-speeds rd,bw,lat x11vnc tries to estimate some speed parameters that\n"
" are used to optimize scheduling (e.g. -pointer_mode\n" " are used to optimize scheduling (e.g. -pointer_mode\n"
" 4, -wireframe, -scrollcopyrect) and other things.\n" " 4, -wireframe, -scrollcopyrect) and other things.\n"
@ -2348,13 +2351,19 @@ void print_help(int mode) {
" For shared memory segments string is of the\n" " For shared memory segments string is of the\n"
" form: \"shm:N@WxHxB\" which specifies a shmid\n" " form: \"shm:N@WxHxB\" which specifies a shmid\n"
" N and framebuffer Width, Height, and Bits\n" " N and framebuffer Width, Height, and Bits\n"
" per pixel. To memory map mmap(2) a file use:\n" " per pixel.\n"
" \"map:/path/to/a/file@WxHxB\". If there is trouble\n" "\n"
" with mmap, use \"file:/...\" for slower lseek(2) based\n" " For file polling to memory map mmap(2) a file use:\n"
" reading. Use \"snap:...\" to imply -snapfb mode and the\n" " \"map:/path/to/a/file@WxHxB\", with WxHxB as above.\n"
" \"file:\" access (this is for devices that only provide\n" " \"mmap:...\" is the same. If there is trouble with mmap,\n"
" the fb all at once). If you do not supply a type \"map\"\n" " use \"file:/...\" for slower lseek(2) based reading.\n"
" is assumed if the file exists.\n" " Use \"snap:...\" to imply -snapfb mode and the \"file:\"\n"
" access (this is for devices that only provide the fb\n"
" all at once).\n"
"\n"
" If you do not supply a type \"map\" is assumed if\n"
" the file exists (see the next paragraphs for some\n"
" exceptions to this.)\n"
"\n" "\n"
" If string is \"setup:cmd\", then the command \"cmd\"\n" " If string is \"setup:cmd\", then the command \"cmd\"\n"
" is run and the first line from it is read and used\n" " is run and the first line from it is read and used\n"
@ -2362,13 +2371,14 @@ void print_help(int mode) {
" determining WxHxB, etc. These are often done as root\n" " determining WxHxB, etc. These are often done as root\n"
" so take care.\n" " so take care.\n"
"\n" "\n"
" If the string begins with \"video\", see the video4linux\n" " If the string begins with \"video\", see the VIDEO4LINUX\n"
" discusion below where the device may be queried for\n" " discusion below where the device may be queried for\n"
" (and possibly set) the framebuffer parameters.\n" " (and possibly set) the framebuffer parameters.\n"
"\n" "\n"
" If the strings begins with \"cons\", see the linux\n" " If the string begins with \"cons\", \"/dev/fb\", or\n"
" console discussion below where the framebuffer device\n" " \"fb\", see the LINUX CONSOLE discussion below where\n"
" is opened and keystrokes are inserted into the console.\n" " the framebuffer device is opened and keystrokes (and\n"
" possibly mouse events) are inserted into the console.\n"
"\n" "\n"
" Optional suffixes are \":R/G/B\" and \"+O\" to specify\n" " Optional suffixes are \":R/G/B\" and \"+O\" to specify\n"
" red, green, and blue masks and an offset into the\n" " red, green, and blue masks and an offset into the\n"
@ -2388,11 +2398,12 @@ void print_help(int mode) {
"\n" "\n"
" (see ipcs(1) and fbset(1) for the first two examples)\n" " (see ipcs(1) and fbset(1) for the first two examples)\n"
"\n" "\n"
" All user input is discarded by default (but see the\n" " In general all user input is discarded by default (see\n"
" -pipeinput option). Most of the X11 (screen, keyboard,\n" " the -pipeinput option for how to use a helper program\n"
" mouse) options do not make sense and many will cause\n" " to insert). Most of the X11 (screen, keyboard, mouse)\n"
" this mode to crash, so please think twice before\n" " options do not make sense and many will cause this\n"
" setting or changing them in a running x11vnc.\n" " mode to crash, so please think twice before setting or\n"
" changing them in a running x11vnc.\n"
"\n" "\n"
" If you DO NOT want x11vnc to close the X DISPLAY in\n" " If you DO NOT want x11vnc to close the X DISPLAY in\n"
" rawfb mode, prepend a \"+\" e.g. +file:/dev/fb0...\n" " rawfb mode, prepend a \"+\" e.g. +file:/dev/fb0...\n"
@ -2411,13 +2422,13 @@ void print_help(int mode) {
" SNAPFB_RAWFB_RESET=1 as well.\n" " SNAPFB_RAWFB_RESET=1 as well.\n"
"\n" "\n"
" If you want x11vnc to dynamically transform a 24bpp\n" " If you want x11vnc to dynamically transform a 24bpp\n"
" rawfb to 32bpp (note that this will be slower) use\n" " rawfb to 32bpp (note that this will be slower) also\n"
" the -24to32 option. This would be useful for, say,\n" " supply the -24to32 option. This would be useful for,\n"
" for a video camera that delivers the pixel data as\n" " say, a video camera that delivers the pixel data as\n"
" 24bpp packed RGB. This is the default under \"video\"\n" " 24bpp packed RGB. This is the default under \"video\"\n"
" mode if the bpp is 24.\n" " mode if the bpp is 24.\n"
"\n" "\n"
" video4linux: on Linux some attempt is made to handle\n" " VIDEO4LINUX: on Linux some attempt is made to handle\n"
" video devices (webcams or TV tuners) automatically.\n" " video devices (webcams or TV tuners) automatically.\n"
" The idea is the WxHxB will be extracted from the\n" " The idea is the WxHxB will be extracted from the\n"
" device itself. So if you do not supply \"@WxHxB...\n" " device itself. So if you do not supply \"@WxHxB...\n"
@ -2495,44 +2506,63 @@ void print_help(int mode) {
"\n" "\n"
" See the -pipeinput VID option below for a way to control\n" " See the -pipeinput VID option below for a way to control\n"
" the settings through the VNC Viewer via keystrokes.\n" " the settings through the VNC Viewer via keystrokes.\n"
" As a shortcut, if the string begins \"Video..\" instead\n"
" of \"video..\" then -pipeinput VID is implied.\n"
"\n" "\n"
" As above, if you specify a \"@WxHxB...\" after the\n" " As above, if you specify a \"@WxHxB...\" after the\n"
" <settings> string they are used verbatim: the device\n" " <settings> string they are used verbatim: the device\n"
" is not queried for the current values. Otherwise the\n" " is not queried for the current values. Otherwise the\n"
" device will be queried.\n" " device will be queried.\n"
"\n" "\n"
" Linux console: If the libvncserver LinuxVNC command is\n" " LINUX CONSOLE: If the libvncserver LinuxVNC program\n"
" on your system use that instead of the following method\n" " is on your system you may want to use that instead of\n"
" because it will be faster and more accurate for Linux\n" " the following method because it will be faster and more\n"
" text console.\n" " accurate for Linux text console.\n"
"\n" "\n"
" If the rawfb string begins with \"cons\" the framebuffer\n" " If the rawfb string begins with \"cons\" the framebuffer\n"
" device /dev/fb0 is opened (this requires the appropriate\n" " device /dev/fb0 is opened (this requires the appropriate\n"
" kernel modules) and so is /dev/tty0. The latter is\n" " kernel modules to be installed) and so is /dev/tty0.\n"
" used to inject keystrokes (not all are supported,\n" " The latter is used to inject keystrokes (not all are\n"
" but the basic ones are). You will need to be root to\n" " supported, but the basic ones are). You will need to\n"
" inject keystrokes. /dev/tty0 refers to the active VT,\n" " be root to inject keystrokes. /dev/tty0 refers to the\n"
" to indicate one explicitly, use \"cons2\", etc. using\n" " active VT, to indicate one explicitly, use \"cons2\",\n"
" the VT number. Note you can change VT remotely using\n" " etc. using the VT number.\n"
" the chvt(1) command. Sometimes switching out and back\n" "\n"
" corrects the framebuffer. To skip injecting entirely\n" " If the Linux version seems to be 2.6 or later and the\n"
" use \"consx\".\n" " \"uinput\" module appears to be present, then the uinput\n"
" method will be used instead of /dev/ttyN. uinput allows\n"
" insertion of BOTH keystrokes and mouse input and so it\n"
" preferred when accessing graphical (e.g. QT-embedded)\n"
" linux console apps. See -pipeinput UINPUT below\n"
" for more information on this mode (you may want to\n"
" also use the -nodragging and -cursor none options).\n"
" Use \"cons0\", etc or -pipeinput CONS to force the\n"
" /dev/ttyN method.\n"
"\n"
" Note you can change VT remotely using the chvt(1)\n"
" command. Sometimes switching out and back corrects\n"
" the framebuffer state.\n"
"\n"
" To skip input injecting entirely use \"consx\".\n"
"\n" "\n"
" The strings \"console\", or \"/dev/fb0\" can be used\n" " The strings \"console\", or \"/dev/fb0\" can be used\n"
" instead of \"cons\". The latter can be used to specify\n" " instead of \"cons\". The latter can be used to specify\n"
" a different framebuffer device, e.g. /dev/fb1. If the\n" " a different framebuffer device, e.g. /dev/fb1. As a\n"
" name is something nonstandard, use \"cons:/dev/foofb\"\n" " shortcut the \"/dev/\" can be dropped. If the name is\n"
" something nonstandard, use \"cons:/dev/foofb\"\n"
"\n" "\n"
" If you do not want x11vnc to guess the framebuffer's\n" " If you do not want x11vnc to guess the framebuffer's\n"
" WxHxB and masks automatically, specify them with a\n" " WxHxB and masks automatically (sometimes the kernel\n"
" given inaccurate information), specify them with a\n"
" @WxHxB at the end of the string.\n" " @WxHxB at the end of the string.\n"
"\n" "\n"
" Examples:\n" " Examples:\n"
" -rawfb cons (same as -rawfb console)\n" " -rawfb cons (same as -rawfb console)\n"
" -rawfb /dev/fb0 (same)\n" " -rawfb /dev/fb0 (same)\n"
" -rawfb cons3 (force /dev/tty3)\n" " -rawfb cons3 (force /dev/tty3)\n"
" -rawfb consx (no keystrokes)\n" " -rawfb consx (no keystrokes or mouse)\n"
" -rawfb console:/dev/nonstd\n" " -rawfb console:/dev/nonstd\n"
" -rawfb cons -pipeinput UINPUT:accel=1.5\n"
"\n" "\n"
"-freqtab file For use with \"-rawfb video\" for TV tuner devices to\n" "-freqtab file For use with \"-rawfb video\" for TV tuner devices to\n"
" specify station frequencies. Instead of using the built\n" " specify station frequencies. Instead of using the built\n"
@ -2561,6 +2591,8 @@ void print_help(int mode) {
" value is stored in X11VNC_RAWFB_STR for the pipe command\n" " value is stored in X11VNC_RAWFB_STR for the pipe command\n"
" to use if it wants. Do 'env | grep X11VNC' for more.\n" " to use if it wants. Do 'env | grep X11VNC' for more.\n"
"\n" "\n"
" Built-in pipeinput modes:\n"
"\n"
" If cmd is \"VID\" and you are using the -rawfb for a\n" " If cmd is \"VID\" and you are using the -rawfb for a\n"
" video capture device, then an internal list of keyboard\n" " video capture device, then an internal list of keyboard\n"
" mappings is used to set parameters of the video.\n" " mappings is used to set parameters of the video.\n"
@ -2579,7 +2611,57 @@ void print_help(int mode) {
"\n" "\n"
" If cmd is \"CONS\" or \"CONSn\" where n is a Linux\n" " If cmd is \"CONS\" or \"CONSn\" where n is a Linux\n"
" console number, then the linux console keystroke\n" " console number, then the linux console keystroke\n"
" insertion (see -rawfb cons) is performed.\n" " insertion to /dev/ttyN (see -rawfb cons) is performed.\n"
"\n"
" If cmd begins with \"UINPUT\" then the Linux uinput\n"
" module is used to insert both keystroke and mouse events\n"
" to the Linux console (see -rawfb above). This usually\n"
" is the /dev/input/uinput device file (you may need to\n"
" 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.\n"
"\n"
" You may want to use the options -cursor none and\n"
" -nodragging in this mode.\n"
"\n"
" Additional tuning options may be supplied via:\n"
" UINPUT:opt1,opt2,... (a comma separated list). If an\n"
" option begins with \"/\" it is taken as the uinput\n"
" device file.\n"
" \n"
" Which uinput is injected can be controlled by an option\n"
" string made of the characters \"K\", \"M\", and \"B\"\n"
" (see the -input option), e.g. \"KM\" allows keystroke\n"
" and motion but not button clicks.\n"
"\n"
" A UINPUT option of the form: accel=f, or accel=fx+fy\n"
" sets the mouse motion \"acceleration\". This is used\n"
" to correct raw mouse relative motion into how much the\n"
" application cursor moves (x11vnc has no control over\n"
" how the application interprets the raw mouse motions).\n"
" Typically the acceleration for an X display is 2 (see\n"
" xset \"m\" option). \"f\" is a floating point number,\n"
" e.g. 2.0. Use \"fx+fy\" if you need to supply different\n"
" corrections for x and y.\n"
"\n"
" Note: the default acceleration is 2.0 since it seems\n"
" both X and qt-embedded often use this value.\n"
"\n"
" Even with a correct accel setting the mouse position\n"
" will get out of sync (probably due to a mouse\n"
" \"threshold\" setting where the acceleration doe not\n"
" apply, set xset(1)). The option reset=N sets the number\n"
" of ms (default 500) after which the cursor is attempted\n"
" to be reset (by forcing the mouse to (0, 0) via small\n"
" increments and then back out to (x, y) in 1 jump), This\n"
" correction seems to be needed but can cause jerkiness\n"
" or unexpected behavior. Use reset=0 to disable.\n"
"\n"
" Example:\n"
" -pipeinput UINPUT:accel=1.0 -cursor none\n"
"\n" "\n"
"-gui [gui-opts] Start up a simple tcl/tk gui based on the the remote\n" "-gui [gui-opts] Start up a simple tcl/tk gui based on the the remote\n"
" control options -remote/-query described below.\n" " control options -remote/-query described below.\n"
@ -2907,6 +2989,8 @@ void print_help(int mode) {
" reset_record reset RECORD extension (if avail.)\n" " reset_record reset RECORD extension (if avail.)\n"
" pointer_mode:n set -pointer_mode to n. same as \"pm\"\n" " pointer_mode:n set -pointer_mode to n. same as \"pm\"\n"
" input_skip:n set -input_skip to n.\n" " input_skip:n set -input_skip to n.\n"
" allinput enable use of -allinput mode.\n"
" noallinput disable use of -allinput mode.\n"
" speeds:str set -speeds to str.\n" " speeds:str set -speeds to str.\n"
" wmdt:str set -wmdt to str.\n" " wmdt:str set -wmdt to str.\n"
" debug_pointer enable -debug_pointer, same as \"dp\"\n" " debug_pointer enable -debug_pointer, same as \"dp\"\n"
@ -2936,6 +3020,8 @@ void print_help(int mode) {
" snapfb enable -snapfb mode.\n" " snapfb enable -snapfb mode.\n"
" nosnapfb disable -snapfb mode.\n" " nosnapfb disable -snapfb mode.\n"
" rawfb:str set -rawfb mode to \"str\".\n" " rawfb:str set -rawfb mode to \"str\".\n"
" uinput_accel:f set uinput_accel to f.\n"
" uinput_reset:n set uinput_reset to n ms.\n"
" progressive:n set libvncserver -progressive slice\n" " progressive:n set libvncserver -progressive slice\n"
" height parameter to n.\n" " height parameter to n.\n"
" desktop:str set -desktop name to str for new clients.\n" " desktop:str set -desktop name to str for new clients.\n"
@ -3009,7 +3095,6 @@ void print_help(int mode) {
" remote command, we hope the name makes it obvious what\n" " remote command, we hope the name makes it obvious what\n"
" the returned value corresponds to (hint: the ext_*\n" " the returned value corresponds to (hint: the ext_*\n"
" variables correspond to the presence of X extensions):\n" " variables correspond to the presence of X extensions):\n"
"\n"
" ans= stop quit exit shutdown ping blacken zero\n" " ans= stop quit exit shutdown ping blacken zero\n"
" refresh reset close disconnect id sid waitmapped\n" " refresh reset close disconnect id sid waitmapped\n"
" nowaitmapped clip flashcmap noflashcmap shiftcmap\n" " nowaitmapped clip flashcmap noflashcmap shiftcmap\n"
@ -3040,16 +3125,17 @@ void print_help(int mode) {
" nodragging wireframe_mode wireframe wf nowireframe\n" " nodragging wireframe_mode wireframe wf nowireframe\n"
" nowf wirecopyrect wcr nowirecopyrect nowcr scr_area\n" " nowf wirecopyrect wcr nowirecopyrect nowcr scr_area\n"
" scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n" " scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n"
" scr_parms scrollcopyrect scr noscrollcopyrect noscr\n" " scr_parms scrollcopyrect scr noscrollcopyrect\n"
" fixscreen noxrecord xrecord reset_record pointer_mode\n" " noscr fixscreen noxrecord xrecord reset_record\n"
" pm input_skip input grabkbd nograbkbd grabptr\n" " pointer_mode pm input_skip allinput noallinput input\n"
" nograbptr client_input speeds wmdt debug_pointer dp\n" " grabkbd nograbkbd grabptr nograbptr client_input\n"
" nodebug_pointer nodp debug_keyboard dk nodebug_keyboard\n" " speeds wmdt debug_pointer dp nodebug_pointer nodp\n"
" nodk deferupdate defer wait_ui wait_bog nowait_bog\n" " debug_keyboard dk nodebug_keyboard nodk deferupdate\n"
" slow_fb wait readtimeout nap nonap sb screen_blank\n" " defer wait_ui wait_bog nowait_bog slow_fb wait\n"
" fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb\n" " readtimeout nap nonap sb screen_blank fbpm nofbpm\n"
" progressive rfbport http nohttp httpport httpdir\n" " fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel\n"
" enablehttpproxy noenablehttpproxy alwaysshared\n" " uinput_reset progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n" " noalwaysshared nevershared noalwaysshared dontdisconnect\n"
" nodontdisconnect desktop debug_xevents nodebug_xevents\n" " nodontdisconnect desktop debug_xevents nodebug_xevents\n"
" debug_xevents debug_xdamage nodebug_xdamage\n" " debug_xevents debug_xdamage nodebug_xdamage\n"
@ -3074,7 +3160,6 @@ void print_help(int mode) {
" mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y\n" " mouse_x mouse_y bpp depth indexed_color dpy_x dpy_y\n"
" wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y\n" " wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y\n"
" rfbauth passwd viewpasswd\n" " rfbauth passwd viewpasswd\n"
"\n"
"-QD variable Just like -query variable, but returns the default\n" "-QD variable Just like -query variable, but returns the default\n"
" value for that parameter (no running x11vnc server\n" " value for that parameter (no running x11vnc server\n"
" is consulted)\n" " is consulted)\n"

@ -2461,6 +2461,7 @@ void get_allowed_input(rfbClientPtr client, allowed_input_t *input) {
str = "KMBC"; str = "KMBC";
} }
} }
if (0) fprintf(stderr, "GAI: %s - %s\n", str, cd->input);
while (*str) { while (*str) {
if (*str == 'K') { if (*str == 'K') {
@ -2485,9 +2486,10 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
if (pipeinput_int == PIPEINPUT_VID) { if (pipeinput_int == PIPEINPUT_VID) {
v4l_key_command(down, keysym, client); v4l_key_command(down, keysym, client);
} } else if (pipeinput_int == PIPEINPUT_CONS) {
if (pipeinput_int == PIPEINPUT_CONS) {
console_key_command(down, keysym, client); console_key_command(down, keysym, client);
} else if (pipeinput_int == PIPEINPUT_UINPUT) {
uinput_key_command(down, keysym, client);
} }
if (pipeinput_fh == NULL) { if (pipeinput_fh == NULL) {
return; return;
@ -2495,7 +2497,7 @@ static void pipe_keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
if (! view_only) { if (! view_only) {
get_allowed_input(client, &input); get_allowed_input(client, &input);
if (input.motion || input.button) { if (input.keystroke) {
can_input = 1; /* XXX distinguish later */ can_input = 1; /* XXX distinguish later */
} }
} }

@ -6,6 +6,7 @@
#include "xinerama.h" #include "xinerama.h"
#include "screen.h" #include "screen.h"
#include "pointer.h" #include "pointer.h"
#include "allowed_input_t.h"
#if LIBVNCSERVER_HAVE_SYS_IOCTL_H #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -21,7 +22,8 @@ void console_pointer_command(int mask, int x, int y, rfbClientPtr client);
char *console_guess(char *str, int *fd) { char *console_guess(char *str, int *fd) {
char *q, *in = strdup(str); char *q, *in = strdup(str);
char *atparms = NULL, *file = NULL; char *atparms = NULL, *file = NULL;
int tty = -1; int do_input, have_uinput, tty = -1;
if (strstr(in, "/dev/fb") == in) { if (strstr(in, "/dev/fb") == in) {
free(in); free(in);
in = (char *) malloc(strlen("cons:") + strlen(str) + 1); in = (char *) malloc(strlen("cons:") + strlen(str) + 1);
@ -67,22 +69,43 @@ char *console_guess(char *str, int *fd) {
} }
rfbLog("console_guess: file is %s\n", file); rfbLog("console_guess: file is %s\n", file);
if (!strcmp(in, "cons") || !strcmp(in, "console")) { do_input = 1;
if (pipeinput_str) {
have_uinput = 0;
do_input = 0;
} else {
have_uinput = check_uinput();
}
if (!strcmp(in, "consx") || !strcmp(in, "consolex")) {
do_input = 0;
} else if (!strcmp(in, "cons") || !strcmp(in, "console")) {
/* current active VT: */ /* current active VT: */
tty = 0; if (! have_uinput) {
tty = 0;
}
} else { } else {
int n; int n;
if (sscanf(in, "cons%d", &n) == 1) { if (sscanf(in, "cons%d", &n) == 1) {
tty = n; tty = n;
have_uinput = 0;
} else if (sscanf(in, "console%d", &n) != 1) { } else if (sscanf(in, "console%d", &n) != 1) {
tty = n; tty = n;
have_uinput = 0;
} }
} }
if (tty >=0 && tty < 64) {
if (pipeinput_str == NULL) { if (do_input) {
if (tty >=0 && tty < 64) {
pipeinput_str = (char *) malloc(10); pipeinput_str = (char *) malloc(10);
sprintf(pipeinput_str, "CONS%d", tty); sprintf(pipeinput_str, "CONS%d", tty);
rfbLog("console_guess: file pipeinput %s\n", pipeinput_str); rfbLog("console_guess: file pipeinput %s\n",
pipeinput_str);
initialize_pipeinput();
} else if (have_uinput) {
pipeinput_str = strdup("UINPUT");
rfbLog("console_guess: file pipeinput %s\n",
pipeinput_str);
initialize_pipeinput(); initialize_pipeinput();
} }
} }
@ -143,10 +166,20 @@ char *console_guess(char *str, int *fd) {
void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
static int control = 0, alt = 0; static int control = 0, alt = 0;
allowed_input_t input;
if (debug_keyboard) fprintf(stderr, "console_key_command: %d %s\n", (int) keysym, down ? "down" : "up"); if (debug_keyboard) fprintf(stderr, "console_key_command: %d %s\n", (int) keysym, down ? "down" : "up");
if (pipeinput_cons_fd < 0) { if (pipeinput_cons_fd < 0) {
return; return;
} }
if (view_only) {
return;
}
get_allowed_input(client, &input);
if (! input.keystroke) {
return;
}
/* From LinuxVNC.c: */ /* From LinuxVNC.c: */
if (keysym == XK_Control_L || keysym == XK_Control_R) { if (keysym == XK_Control_L || keysym == XK_Control_R) {
@ -250,6 +283,7 @@ void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
} }
void console_pointer_command(int mask, int x, int y, rfbClientPtr client) { void console_pointer_command(int mask, int x, int y, rfbClientPtr client) {
/* do not forget viewonly perms */
if (mask || x || y || client) {} if (mask || x || y || client) {}
} }

@ -290,6 +290,7 @@ int naptile = 4; /* tile change threshold per poll to take a nap */
int napfac = 4; /* time = napfac*waitms, cut load with extra waits */ int napfac = 4; /* time = napfac*waitms, cut load with extra waits */
int napmax = 1500; /* longest nap in ms. */ int napmax = 1500; /* longest nap in ms. */
int ui_skip = 10; /* see watchloop. negative means ignore input */ int ui_skip = 10; /* see watchloop. negative means ignore input */
int all_input = 0;
#if LIBVNCSERVER_HAVE_FBPM #if LIBVNCSERVER_HAVE_FBPM

@ -219,6 +219,7 @@ extern int naptile;
extern int napfac; extern int napfac;
extern int napmax; extern int napmax;
extern int ui_skip; extern int ui_skip;
extern int all_input;
extern int watch_fbpm; extern int watch_fbpm;

@ -35,8 +35,11 @@
#define MAXN 256 #define MAXN 256
#define PIPEINPUT_NONE 0x0 #define PIPEINPUT_NONE 0x0
#define PIPEINPUT_VID 0x1 #define PIPEINPUT_VID 0x1
#define PIPEINPUT_CONS 0x2 #define PIPEINPUT_CONS 0x2
#define PIPEINPUT_UINPUT 0x3
#define MAX_BUTTONS 5
#endif /* _X11VNC_PARAMS_H */ #endif /* _X11VNC_PARAMS_H */

@ -43,7 +43,6 @@ typedef struct ptrremap {
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
MUTEX(pointerMutex); MUTEX(pointerMutex);
#endif #endif
#define MAX_BUTTONS 5
#define MAX_BUTTON_EVENTS 50 #define MAX_BUTTON_EVENTS 50
static prtremap_t pointer_map[MAX_BUTTONS+1][MAX_BUTTON_EVENTS]; static prtremap_t pointer_map[MAX_BUTTONS+1][MAX_BUTTON_EVENTS];
@ -522,9 +521,10 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
if (pipeinput_int == PIPEINPUT_VID) { if (pipeinput_int == PIPEINPUT_VID) {
v4l_pointer_command(mask, x, y, client); v4l_pointer_command(mask, x, y, client);
} } else if (pipeinput_int == PIPEINPUT_CONS) {
if (pipeinput_int == PIPEINPUT_CONS) {
console_pointer_command(mask, x, y, client); console_pointer_command(mask, x, y, client);
} else if (pipeinput_int == PIPEINPUT_UINPUT) {
uinput_pointer_command(mask, x, y, client);
} }
if (pipeinput_fh == NULL) { if (pipeinput_fh == NULL) {
return; return;
@ -536,6 +536,7 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
can_input = 1; /* XXX distinguish later */ can_input = 1; /* XXX distinguish later */
} }
} }
if (cd) { if (cd) {
uid = cd->uid; uid = cd->uid;
} }
@ -594,6 +595,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
if (mask >= 0) { if (mask >= 0) {
got_pointer_calls++; got_pointer_calls++;
} }
get_allowed_input(client, &input);
if (debug_pointer && mask >= 0) { if (debug_pointer && mask >= 0) {
static int show_motion = -1; static int show_motion = -1;
@ -631,7 +633,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
y = nfix(y, dpy_y); y = nfix(y, dpy_y);
} }
if (pipeinput_fh != NULL && mask >= 0) { if ((pipeinput_fh != NULL || pipeinput_int) && mask >= 0) {
pipe_pointer(mask, x, y, client); pipe_pointer(mask, x, y, client);
if (! pipeinput_tee) { if (! pipeinput_tee) {
if (! view_only || raw_fb) { /* raw_fb hack */ if (! view_only || raw_fb) { /* raw_fb hack */
@ -639,7 +641,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
got_keyboard_input++; got_keyboard_input++;
last_pointer_client = client; last_pointer_client = client;
} }
if (view_only && raw_fb) { if (input.motion) {
/* raw_fb hack track button state */ /* raw_fb hack track button state */
button_mask_prev = button_mask; button_mask_prev = button_mask;
button_mask = mask; button_mask = mask;
@ -659,7 +661,6 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
* mask = -1 is a special case call from scan_for_updates() * mask = -1 is a special case call from scan_for_updates()
* to flush the event queue; there is no real pointer event. * to flush the event queue; there is no real pointer event.
*/ */
get_allowed_input(client, &input);
if (! input.motion && ! input.button) { if (! input.motion && ! input.button) {
return; return;
} }
@ -863,7 +864,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
} }
void initialize_pipeinput(void) { void initialize_pipeinput(void) {
char *p; char *p = NULL;
if (pipeinput_fh != NULL) { if (pipeinput_fh != NULL) {
rfbLog("closing pipeinput stream: %p\n", pipeinput_fh); rfbLog("closing pipeinput stream: %p\n", pipeinput_fh);
@ -882,7 +883,11 @@ void initialize_pipeinput(void) {
} }
/* look for options: tee, reopen, ... */ /* look for options: tee, reopen, ... */
p = strchr(pipeinput_str, ':'); if (strstr(pipeinput_str, "UINPUT") == pipeinput_str) {
;
} else {
p = strchr(pipeinput_str, ':');
}
if (p != NULL) { if (p != NULL) {
char *str, *opt, *q; char *str, *opt, *q;
int got = 0; int got = 0;
@ -919,8 +924,7 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
if (!strcmp(p, "VID")) { if (!strcmp(p, "VID")) {
pipeinput_int = PIPEINPUT_VID; pipeinput_int = PIPEINPUT_VID;
return; return;
} } else if (strstr(p, "CONS") == p) {
if (strstr(p, "CONS") == p) {
int tty = 0, n; int tty = 0, n;
char dev[32]; char dev[32];
if (sscanf(p, "CONS%d", &n) == 1) { if (sscanf(p, "CONS%d", &n) == 1) {
@ -940,6 +944,14 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
rfbLogPerror("open"); rfbLogPerror("open");
} }
return; return;
} else if (strstr(p, "UINPUT") == p) {
char *q = strchr(p, ':');
if (q) {
parse_uinput_str(q+1);
}
pipeinput_int = PIPEINPUT_UINPUT;
initialize_uinput();
return;
} }
set_child_info(); set_child_info();
@ -990,16 +1002,16 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
"# It can be:\n" "# It can be:\n"
"#\n" "#\n"
"# None (nothing to report)\n" "# None (nothing to report)\n"
"# ButtonPress-N (this event will cause button-1 to be pressed) \n" "# ButtonPress-N (this event will cause button-N to be pressed) \n"
"# ButtonRelease-N (this event will cause button-1 to be released) \n" "# ButtonRelease-N (this event will cause button-N to be released) \n"
"#\n" "#\n"
"# if two more more buttons change state in one event they are listed\n" "# if two more more buttons change state in one event they are listed\n"
"# separated by commas.\n" "# separated by commas.\n"
"#\n" "#\n"
"# One might parse a Pointer line with:\n" "# One might parse a Pointer line with:\n"
"#\n" "#\n"
"# int client, x, y, mask; char *hint;\n" "# int client, x, y, mask; char hint[100];\n"
"# sscanf(line, \"Pointer %d %d %d %s\", &client, &x, &y, &mask, &hint);\n" "# sscanf(line, \"Pointer %d %d %d %d %s\", &client, &x, &y, &mask, hint);\n"
"#\n" "#\n"
"#\n" "#\n"
"# Keysym events (keyboard presses and releases) come in the form:\n" "# Keysym events (keyboard presses and releases) come in the form:\n"
@ -1023,8 +1035,8 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
"#\n" "#\n"
"# One might parse a Keysym line with:\n" "# One might parse a Keysym line with:\n"
"#\n" "#\n"
"# int client, down, keysym; char *name, *hint;\n" "# int client, down, keysym; char name[100], hint[100];\n"
"# sscanf(line, \"Keysym %d %d %s %s\", &client, &down, &keysym, &name, &hint);\n" "# sscanf(line, \"Keysym %d %d %d %s %s\", &client, &down, &keysym, name, hint);\n"
"#\n" "#\n"
"# The <hint> value is currently just None, KeyPress, or KeyRelease.\n" "# The <hint> value is currently just None, KeyPress, or KeyRelease.\n"
"#\n" "#\n"
@ -1041,6 +1053,20 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
"# info will be enough for most purposes (having identical keyboards on\n" "# info will be enough for most purposes (having identical keyboards on\n"
"# both sides helps).\n" "# both sides helps).\n"
"#\n" "#\n"
"# Parsing example for perl:\n"
"#\n"
"# while (<>) {\n"
"# chomp;\n"
"# if (/^Pointer/) {\n"
"# my ($p, $client, $x, $y, $mask, $hint) = split(' ', $_, 6);\n"
"# do_pointer($client, $x, $y, $mask, $hint);\n"
"# } elsif (/^Keysym/) {\n"
"# my ($k, $client, $down, $keysym, $name, $hint) = split(' ', $_, 6);\n"
"# do_keysym($client, $down, $keysym, $name, $hint);\n"
"# }\n"
"# }\n"
"#\n"
"#\n"
"# Here comes your stream. The following token will always indicate the\n" "# Here comes your stream. The following token will always indicate the\n"
"# end of this informational text:\n" "# end of this informational text:\n"
"# END_OF_TOP\n" "# END_OF_TOP\n"

@ -24,6 +24,7 @@
#include "keyboard.h" #include "keyboard.h"
#include "selection.h" #include "selection.h"
#include "unixpw.h" #include "unixpw.h"
#include "uinput.h"
int send_remote_cmd(char *cmd, int query, int wait); int send_remote_cmd(char *cmd, int query, int wait);
int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync, int do_remote_query(char *remote_cmd, char *query_cmd, int remote_sync,
@ -3029,6 +3030,21 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: setting input_skip %d\n", is); rfbLog("remote_cmd: setting input_skip %d\n", is);
ui_skip = is; ui_skip = is;
} else if (!strcmp(p, "allinput")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, all_input);
goto qry;
}
all_input = 1;
rfbLog("enabled allinput\n");
} else if (!strcmp(p, "noallinput")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !all_input);
goto qry;
}
all_input = 0;
rfbLog("disabled allinput\n");
} else if (strstr(p, "input") == p) { } else if (strstr(p, "input") == p) {
int doit = 1; int doit = 1;
COLON_CHECK("input:") COLON_CHECK("input:")
@ -3436,6 +3452,28 @@ char *process_remote_cmd(char *cmd, int stringonly) {
do_new_fb(1); do_new_fb(1);
raw_fb_back_to_X = 0; raw_fb_back_to_X = 0;
} else if (strstr(p, "uinput_accel") == p) {
COLON_CHECK("uinput_accel:")
if (query) {
snprintf(buf, bufn, "ans=%s%s%s", p, co,
NONUL(get_uinput_accel()));
goto qry;
}
p += strlen("uinput_accel:");
rfbLog("set_uinput_accel: %s\n", p);
set_uinput_accel(p);
} else if (strstr(p, "uinput_reset") == p) {
COLON_CHECK("uinput_reset:")
p += strlen("uinput_reset:");
if (query) {
snprintf(buf, bufn, "ans=%s%s%d", p, co,
get_uinput_reset());
goto qry;
}
rfbLog("set_uinput_reset: %s\n", p);
set_uinput_reset(atoi(p));
} else if (strstr(p, "progressive") == p) { } else if (strstr(p, "progressive") == p) {
int f; int f;
COLON_CHECK("progressive:") COLON_CHECK("progressive:")

@ -574,10 +574,12 @@ void set_raw_fb_params(int restore) {
} }
} else { } else {
/* Normal case: */ /* Normal case: */
if (! view_only) { #if 0
if (! view_only && ! pipeinput_str) {
if (! quiet) rfbLog(" rawfb: setting view_only\n"); if (! quiet) rfbLog(" rawfb: setting view_only\n");
view_only = 1; view_only = 1;
} }
#endif
if (watch_selection) { if (watch_selection) {
if (! quiet) rfbLog(" rawfb: turning off " if (! quiet) rfbLog(" rawfb: turning off "
"watch_selection\n"); "watch_selection\n");
@ -609,10 +611,6 @@ void set_raw_fb_params(int restore) {
} }
multiple_cursors_mode = strdup("arrow"); multiple_cursors_mode = strdup("arrow");
} }
if (0 && use_snapfb) {
if (! quiet) rfbLog(" rawfb: turning off use_snapfb\n");
use_snapfb = 0;
}
if (using_shm) { if (using_shm) {
if (! quiet) rfbLog(" rawfb: turning off using_shm\n"); if (! quiet) rfbLog(" rawfb: turning off using_shm\n");
using_shm = 0; using_shm = 0;
@ -963,7 +961,8 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
rawfb_dev_video = 1; rawfb_dev_video = 1;
} else if (strstr(str, "dev/video")) { } else if (strstr(str, "dev/video")) {
rawfb_dev_video = 1; rawfb_dev_video = 1;
} else if (strstr(str, "cons") == str || strstr(str, "/dev/fb") == str) { } else if (strstr(str, "cons") == str || strstr(str, "fb") == str ||
strstr(str, "/dev/fb") == str) {
char *str2 = console_guess(str, &raw_fb_fd); char *str2 = console_guess(str, &raw_fb_fd);
if (str2 == NULL) { if (str2 == NULL) {
rfbLog("console_guess failed for: %s\n", str); rfbLog("console_guess failed for: %s\n", str);

@ -178,6 +178,8 @@ Screen
visual: visual:
rawfb: rawfb:
pipeinput: pipeinput:
uinput_accel:
uinput_reset:
24to32 24to32
=GAL LOFF =GAL LOFF
@ -317,6 +319,7 @@ Permissions
Tuning Tuning
=D-C:0,1,2,3,4 pointer_mode: =D-C:0,1,2,3,4 pointer_mode:
input_skip: input_skip:
allinput
=D nodragging =D nodragging
-- D -- D
speeds: speeds:

@ -189,6 +189,8 @@ char gui_code[] = "";
" visual:\n" " visual:\n"
" rawfb:\n" " rawfb:\n"
" pipeinput:\n" " pipeinput:\n"
" uinput_accel:\n"
" uinput_reset:\n"
" 24to32\n" " 24to32\n"
" =GAL LOFF\n" " =GAL LOFF\n"
"\n" "\n"
@ -328,6 +330,7 @@ char gui_code[] = "";
"Tuning\n" "Tuning\n"
" =D-C:0,1,2,3,4 pointer_mode:\n" " =D-C:0,1,2,3,4 pointer_mode:\n"
" input_skip:\n" " input_skip:\n"
" allinput\n"
" =D nodragging\n" " =D nodragging\n"
" -- D\n" " -- D\n"
" speeds:\n" " speeds:\n"

File diff suppressed because it is too large Load Diff

@ -0,0 +1,18 @@
#ifndef _X11VNC_UINPUT_H
#define _X11VNC_UINPUT_H
/* -- uinput.h -- */
extern int check_uinput(void);
extern int initialize_uinput(void);
extern int set_uinput_accel(char *str);
extern void set_uinput_reset(int ms);
extern char *get_uinput_accel();
extern int get_uinput_reset();
extern void parse_uinput_str(char *str);
extern void uinput_pointer_command(int mask, int x, int y, rfbClientPtr client);
extern void uinput_key_command(int down, int keysym, rfbClientPtr client);
#endif /* _X11VNC_UINPUT_H */

@ -446,7 +446,24 @@ void rfbCFD(long usec) {
} }
if (! use_threads) { if (! use_threads) {
rfbCheckFds(screen, usec); if (0 && all_input) {
static int cnt = 0;
int f = 1;
while (rfbCheckFds(screen, usec) > 0) {
if (f) {
cnt++;
f = 0;
}
fprintf(stderr, "-%d", cnt);
}
} else {
if (all_input) {
screen->handleEventsEagerly = TRUE;
} else {
screen->handleEventsEagerly = FALSE;
}
rfbCheckFds(screen, usec);
}
} }
if (unixpw && unixpw_in_progress && !uip0) { if (unixpw && unixpw_in_progress && !uip0) {

@ -6,6 +6,7 @@
#include "xinerama.h" #include "xinerama.h"
#include "screen.h" #include "screen.h"
#include "connections.h" #include "connections.h"
#include "allowed_input_t.h"
#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H #if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_H
#if LIBVNCSERVER_HAVE_SYS_IOCTL_H #if LIBVNCSERVER_HAVE_SYS_IOCTL_H
@ -556,12 +557,22 @@ static void v4l_fmt(char *fmt) {
} }
void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) { void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
allowed_input_t input;
if (raw_fb_fd < 0) { if (raw_fb_fd < 0) {
return; return;
} }
if (! down) { if (! down) {
return; return;
} }
if (view_only) {
return;
}
get_allowed_input(client, &input);
if (! input.keystroke) {
return;
}
if (keysym == XK_b) { if (keysym == XK_b) {
v4l_br(-1); v4l_br(-1);
} else if (keysym == XK_B) { } else if (keysym == XK_B) {
@ -608,6 +619,7 @@ void v4l_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
void v4l_pointer_command(int mask, int x, int y, rfbClientPtr client) { void v4l_pointer_command(int mask, int x, int y, rfbClientPtr client) {
/* do not forget viewonly perms */
if (mask || x || y || client) {} if (mask || x || y || client) {}
} }

@ -2,7 +2,7 @@
.TH X11VNC "1" "July 2006" "x11vnc " "User Commands" .TH X11VNC "1" "July 2006" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.8.2, lastmod: 2006-07-04 version: 0.8.2, lastmod: 2006-07-08
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
@ -2569,6 +2569,11 @@ read n user input events before scanning display. n < 0
means to act as though there is always user input. means to act as though there is always user input.
Default: 10 Default: 10
.PP .PP
\fB-allinput\fR
.IP
Have x11vnc read and process all available client input
before proceeding.
.PP
\fB-speeds\fR \fIrd,bw,lat\fR \fB-speeds\fR \fIrd,bw,lat\fR
.IP .IP
x11vnc tries to estimate some speed parameters that x11vnc tries to estimate some speed parameters that
@ -2794,17 +2799,23 @@ memory object specified in \fIstring\fR.
For shared memory segments string is of the For shared memory segments string is of the
form: "shm:N@WxHxB" which specifies a shmid form: "shm:N@WxHxB" which specifies a shmid
N and framebuffer Width, Height, and Bits N and framebuffer Width, Height, and Bits
per pixel. To memory map per pixel.
.IP
For file polling to memory map
.IR mmap (2) .IR mmap (2)
a file use: a file use:
"map:/path/to/a/file@WxHxB". If there is trouble "map:/path/to/a/file@WxHxB", with WxHxB as above.
with mmap, use "file:/..." for slower "mmap:..." is the same. If there is trouble with mmap,
use "file:/..." for slower
.IR lseek (2) .IR lseek (2)
based based reading.
reading. Use "snap:..." to imply \fB-snapfb\fR mode and the Use "snap:..." to imply \fB-snapfb\fR mode and the "file:"
"file:" access (this is for devices that only provide access (this is for devices that only provide the fb
the fb all at once). If you do not supply a type "map" all at once).
is assumed if the file exists. .IP
If you do not supply a type "map" is assumed if
the file exists (see the next paragraphs for some
exceptions to this.)
.IP .IP
If string is "setup:cmd", then the command "cmd" If string is "setup:cmd", then the command "cmd"
is run and the first line from it is read and used is run and the first line from it is read and used
@ -2812,13 +2823,14 @@ as \fIstring\fR. This allows initializing the device,
determining WxHxB, etc. These are often done as root determining WxHxB, etc. These are often done as root
so take care. so take care.
.IP .IP
If the string begins with "video", see the video4linux If the string begins with "video", see the VIDEO4LINUX
discusion below where the device may be queried for discusion below where the device may be queried for
(and possibly set) the framebuffer parameters. (and possibly set) the framebuffer parameters.
.IP .IP
If the strings begins with "cons", see the linux If the string begins with "cons", "/dev/fb", or
console discussion below where the framebuffer device "fb", see the LINUX CONSOLE discussion below where
is opened and keystrokes are inserted into the console. the framebuffer device is opened and keystrokes (and
possibly mouse events) are inserted into the console.
.IP .IP
Optional suffixes are ":R/G/B" and "+O" to specify Optional suffixes are ":R/G/B" and "+O" to specify
red, green, and blue masks and an offset into the red, green, and blue masks and an offset into the
@ -2847,11 +2859,12 @@ and
.IR fbset (1) .IR fbset (1)
for the first two examples) for the first two examples)
.IP .IP
All user input is discarded by default (but see the In general all user input is discarded by default (see
\fB-pipeinput\fR option). Most of the X11 (screen, keyboard, the \fB-pipeinput\fR option for how to use a helper program
mouse) options do not make sense and many will cause to insert). Most of the X11 (screen, keyboard, mouse)
this mode to crash, so please think twice before options do not make sense and many will cause this
setting or changing them in a running x11vnc. mode to crash, so please think twice before setting or
changing them in a running x11vnc.
.IP .IP
If you DO NOT want x11vnc to close the X DISPLAY in If you DO NOT want x11vnc to close the X DISPLAY in
rawfb mode, prepend a "+" e.g. +file:/dev/fb0... rawfb mode, prepend a "+" e.g. +file:/dev/fb0...
@ -2870,13 +2883,13 @@ snapfb snapshot, set the environment variable:
SNAPFB_RAWFB_RESET=1 as well. SNAPFB_RAWFB_RESET=1 as well.
.IP .IP
If you want x11vnc to dynamically transform a 24bpp If you want x11vnc to dynamically transform a 24bpp
rawfb to 32bpp (note that this will be slower) use rawfb to 32bpp (note that this will be slower) also
the \fB-24to32\fR option. This would be useful for, say, supply the \fB-24to32\fR option. This would be useful for,
for a video camera that delivers the pixel data as say, a video camera that delivers the pixel data as
24bpp packed RGB. This is the default under "video" 24bpp packed RGB. This is the default under "video"
mode if the bpp is 24. mode if the bpp is 24.
.IP .IP
video4linux: on Linux some attempt is made to handle VIDEO4LINUX: on Linux some attempt is made to handle
video devices (webcams or TV tuners) automatically. video devices (webcams or TV tuners) automatically.
The idea is the WxHxB will be extracted from the The idea is the WxHxB will be extracted from the
device itself. So if you do not supply "@WxHxB... device itself. So if you do not supply "@WxHxB...
@ -2956,46 +2969,64 @@ all of the above settings.
.IP .IP
See the \fB-pipeinput\fR VID option below for a way to control See the \fB-pipeinput\fR VID option below for a way to control
the settings through the VNC Viewer via keystrokes. the settings through the VNC Viewer via keystrokes.
As a shortcut, if the string begins "Video.." instead
of "video.." then \fB-pipeinput\fR VID is implied.
.IP .IP
As above, if you specify a "@WxHxB..." after the As above, if you specify a "@WxHxB..." after the
<settings> string they are used verbatim: the device <settings> string they are used verbatim: the device
is not queried for the current values. Otherwise the is not queried for the current values. Otherwise the
device will be queried. device will be queried.
.IP .IP
Linux console: If the libvncserver LinuxVNC command is LINUX CONSOLE: If the libvncserver LinuxVNC program
on your system use that instead of the following method is on your system you may want to use that instead of
because it will be faster and more accurate for Linux the following method because it will be faster and more
text console. accurate for Linux text console.
.IP .IP
If the rawfb string begins with "cons" the framebuffer If the rawfb string begins with "cons" the framebuffer
device /dev/fb0 is opened (this requires the appropriate device /dev/fb0 is opened (this requires the appropriate
kernel modules) and so is /dev/tty0. The latter is kernel modules to be installed) and so is /dev/tty0.
used to inject keystrokes (not all are supported, The latter is used to inject keystrokes (not all are
but the basic ones are). You will need to be root to supported, but the basic ones are). You will need to
inject keystrokes. /dev/tty0 refers to the active VT, be root to inject keystrokes. /dev/tty0 refers to the
to indicate one explicitly, use "cons2", etc. using active VT, to indicate one explicitly, use "cons2",
the VT number. Note you can change VT remotely using etc. using the VT number.
the .IP
If the Linux version seems to be 2.6 or later and the
"uinput" module appears to be present, then the uinput
method will be used instead of /dev/ttyN. uinput allows
insertion of BOTH keystrokes and mouse input and so it
preferred when accessing graphical (e.g. QT-embedded)
linux console apps. See \fB-pipeinput\fR UINPUT below
for more information on this mode (you may want to
also use the \fB-nodragging\fR and \fB-cursor\fR none options).
Use "cons0", etc or \fB-pipeinput\fR CONS to force the
/dev/ttyN method.
.IP
Note you can change VT remotely using the
.IR chvt (1) .IR chvt (1)
command. Sometimes switching out and back command. Sometimes switching out and back corrects
corrects the framebuffer. To skip injecting entirely the framebuffer state.
use "consx". .IP
To skip input injecting entirely use "consx".
.IP .IP
The strings "console", or "/dev/fb0" can be used The strings "console", or "/dev/fb0" can be used
instead of "cons". The latter can be used to specify instead of "cons". The latter can be used to specify
a different framebuffer device, e.g. /dev/fb1. If the a different framebuffer device, e.g. /dev/fb1. As a
name is something nonstandard, use "cons:/dev/foofb" shortcut the "/dev/" can be dropped. If the name is
something nonstandard, use "cons:/dev/foofb"
.IP .IP
If you do not want x11vnc to guess the framebuffer's If you do not want x11vnc to guess the framebuffer's
WxHxB and masks automatically, specify them with a WxHxB and masks automatically (sometimes the kernel
given inaccurate information), specify them with a
@WxHxB at the end of the string. @WxHxB at the end of the string.
.IP .IP
Examples: Examples:
\fB-rawfb\fR cons (same as \fB-rawfb\fR console) \fB-rawfb\fR cons (same as \fB-rawfb\fR console)
\fB-rawfb\fR /dev/fb0 (same) \fB-rawfb\fR /dev/fb0 (same)
\fB-rawfb\fR cons3 (force /dev/tty3) \fB-rawfb\fR cons3 (force /dev/tty3)
\fB-rawfb\fR consx (no keystrokes) \fB-rawfb\fR consx (no keystrokes or mouse)
\fB-rawfb\fR console:/dev/nonstd \fB-rawfb\fR console:/dev/nonstd
\fB-rawfb\fR cons \fB-pipeinput\fR UINPUT:accel=1.5
.PP .PP
\fB-freqtab\fR \fIfile\fR \fB-freqtab\fR \fIfile\fR
.IP .IP
@ -3028,6 +3059,8 @@ To facilitate this, if \fB-rawfb\fR is in effect then the
value is stored in X11VNC_RAWFB_STR for the pipe command value is stored in X11VNC_RAWFB_STR for the pipe command
to use if it wants. Do 'env | grep X11VNC' for more. to use if it wants. Do 'env | grep X11VNC' for more.
.IP .IP
Built-in pipeinput modes:
.IP
If cmd is "VID" and you are using the \fB-rawfb\fR for a If cmd is "VID" and you are using the \fB-rawfb\fR for a
video capture device, then an internal list of keyboard video capture device, then an internal list of keyboard
mappings is used to set parameters of the video. mappings is used to set parameters of the video.
@ -3046,7 +3079,59 @@ GREY respectively. See \fB-rawfb\fR video for details.
.IP .IP
If cmd is "CONS" or "CONSn" where n is a Linux If cmd is "CONS" or "CONSn" where n is a Linux
console number, then the linux console keystroke console number, then the linux console keystroke
insertion (see \fB-rawfb\fR cons) is performed. insertion to /dev/ttyN (see \fB-rawfb\fR cons) is performed.
.IP
If cmd begins with "UINPUT" then the Linux uinput
module is used to insert both keystroke and mouse events
to the Linux console (see \fB-rawfb\fR above). This usually
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
The UINPUT mode currently only does US keyboards (a
scan code option may be added), and not all keysyms
are supported.
.IP
You may want to use the options \fB-cursor\fR none and
\fB-nodragging\fR in this mode.
.IP
Additional tuning options may be supplied via:
UINPUT:opt1,opt2,... (a comma separated list). If an
option begins with "/" it is taken as the uinput
device file.
.IP
Which uinput is injected can be controlled by an option
string made of the characters "K", "M", and "B"
(see the \fB-input\fR option), e.g. "KM" allows keystroke
and motion but not button clicks.
.IP
A UINPUT option of the form: accel=f, or accel=fx+fy
sets the mouse motion "acceleration". This is used
to correct raw mouse relative motion into how much the
application cursor moves (x11vnc has no control over
how the application interprets the raw mouse motions).
Typically the acceleration for an X display is 2 (see
xset "m" option). "f" is a floating point number,
e.g. 2.0. Use "fx+fy" if you need to supply different
corrections for x and y.
.IP
Note: the default acceleration is 2.0 since it seems
both X and qt-embedded often use this value.
.IP
Even with a correct accel setting the mouse position
will get out of sync (probably due to a mouse
"threshold" setting where the acceleration doe not
apply, set
.IR xset (1)
). The option reset=N sets the number
of ms (default 500) after which the cursor is attempted
to be reset (by forcing the mouse to (0, 0) via small
increments and then back out to (x, y) in 1 jump), This
correction seems to be needed but can cause jerkiness
or unexpected behavior. Use reset=0 to disable.
.IP
Example:
\fB-pipeinput\fR UINPUT:accel=1.0 \fB-cursor\fR none
.PP .PP
\fB-gui\fR \fI[gui-opts]\fR \fB-gui\fR \fI[gui-opts]\fR
.IP .IP
@ -3526,6 +3611,10 @@ pointer_mode:n set \fB-pointer_mode\fR to n. same as "pm"
.IP .IP
input_skip:n set \fB-input_skip\fR to n. input_skip:n set \fB-input_skip\fR to n.
.IP .IP
allinput enable use of \fB-allinput\fR mode.
.IP
noallinput disable use of \fB-allinput\fR mode.
.IP
speeds:str set \fB-speeds\fR to str. speeds:str set \fB-speeds\fR to str.
.IP .IP
wmdt:str set \fB-wmdt\fR to str. wmdt:str set \fB-wmdt\fR to str.
@ -3584,6 +3673,10 @@ nosnapfb disable \fB-snapfb\fR mode.
.IP .IP
rawfb:str set \fB-rawfb\fR mode to "str". rawfb:str set \fB-rawfb\fR mode to "str".
.IP .IP
uinput_accel:f set uinput_accel to f.
.IP
uinput_reset:n set uinput_reset to n ms.
.IP
progressive:n set libvncserver \fB-progressive\fR slice progressive:n set libvncserver \fB-progressive\fR slice
height parameter to n. height parameter to n.
.IP .IP
@ -3703,7 +3796,6 @@ names that do not correspond to an x11vnc option or
remote command, we hope the name makes it obvious what remote command, we hope the name makes it obvious what
the returned value corresponds to (hint: the ext_* the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions): variables correspond to the presence of X extensions):
.IP
ans= stop quit exit shutdown ping blacken zero ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid waitmapped refresh reset close disconnect id sid waitmapped
nowaitmapped clip flashcmap noflashcmap shiftcmap nowaitmapped clip flashcmap noflashcmap shiftcmap
@ -3734,16 +3826,17 @@ xwarp noxwarppointer noxwarp buttonmap dragging
nodragging wireframe_mode wireframe wf nowireframe nodragging wireframe_mode wireframe wf nowireframe
nowf wirecopyrect wcr nowirecopyrect nowcr scr_area nowf wirecopyrect wcr nowirecopyrect nowcr scr_area
scr_skip scr_inc scr_keys scr_term scr_keyrepeat scr_skip scr_inc scr_keys scr_term scr_keyrepeat
scr_parms scrollcopyrect scr noscrollcopyrect noscr scr_parms scrollcopyrect scr noscrollcopyrect
fixscreen noxrecord xrecord reset_record pointer_mode noscr fixscreen noxrecord xrecord reset_record
pm input_skip input grabkbd nograbkbd grabptr pointer_mode pm input_skip allinput noallinput input
nograbptr client_input speeds wmdt debug_pointer dp grabkbd nograbkbd grabptr nograbptr client_input
nodebug_pointer nodp debug_keyboard dk nodebug_keyboard speeds wmdt debug_pointer dp nodebug_pointer nodp
nodk deferupdate defer wait_ui wait_bog nowait_bog debug_keyboard dk nodebug_keyboard nodk deferupdate
slow_fb wait readtimeout nap nonap sb screen_blank defer wait_ui wait_bog nowait_bog slow_fb wait
fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb readtimeout nap nonap sb screen_blank fbpm nofbpm
progressive rfbport http nohttp httpport httpdir fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel
enablehttpproxy noenablehttpproxy alwaysshared uinput_reset progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage debug_xevents debug_xdamage nodebug_xdamage

@ -2073,6 +2073,10 @@ int main(int argc, char* argv[]) {
CHECK_ARGC CHECK_ARGC
ui_skip = atoi(argv[++i]); ui_skip = atoi(argv[++i]);
if (! ui_skip) ui_skip = 1; if (! ui_skip) ui_skip = 1;
} else if (!strcmp(arg, "-allinput")) {
all_input = 1;
} else if (!strcmp(arg, "-noallinput")) {
all_input = 0;
} else if (!strcmp(arg, "-speeds")) { } else if (!strcmp(arg, "-speeds")) {
CHECK_ARGC CHECK_ARGC
speeds_str = strdup(argv[++i]); speeds_str = strdup(argv[++i]);

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.8.2 lastmod: 2006-07-04"; char lastmod[] = "0.8.2 lastmod: 2006-07-08";
/* X display info */ /* X display info */

Loading…
Cancel
Save