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>
* 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_LINUX_VIDEODEV_H, [video4linux 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,
[ --without-xkeyboard disable xkeyboard extension support],,)
@ -83,6 +85,8 @@ AC_ARG_WITH(v4l,
[ --without-v4l disable video4linux support],,)
AC_ARG_WITH(fbdev,
[ --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
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_DEFINE(HAVE_LINUX_FB_H)],,)
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"
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>
* x11vnc: 2nd -accept popup with WAIT, and UNIX: info for unixpw
login. Use RFB_CLIENT_ON_HOLD for -unixpw. -unixpw white arrow

@ -13,7 +13,7 @@ endif
if HAVE_X
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@
x11vnc_LDADD=$(LDADD) @X_LIBS@ $(LD_CYGIPC)
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:
@ -7196,7 +7196,7 @@ x11vnc: a VNC server for real X displays
Here are all of x11vnc command line options:
% 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:
-display disp -auth file -id windowid
@ -7246,21 +7246,21 @@ x11vnc options:
-fixscreen string -debug_scroll -noxrecord
-grab_buster -nograb_buster -debug_grabs
-debug_sel -pointer_mode n -input_skip n
-speeds rd,bw,lat -wmdt string -debug_pointer
-debug_keyboard -defer time -wait time
-wait_ui factor -nowait_bog -slow_fb time
-readtimeout n -nap -nonap
-sb time -nofbpm -fbpm
-noxdamage -xd_area A -xd_mem f
-sigpipe string -threads -nothreads
-fs f -gaps n -grow n
-fuzz n -debug_tiles -snapfb
-rawfb string -freqtab file -pipeinput cmd
-gui [gui-opts] -remote command -query variable
-QD variable -sync -noremote
-yesremote -unsafe -safer
-privremote -nocmds -allowedcmds list
-deny_all
-allinput -speeds rd,bw,lat -wmdt string
-debug_pointer -debug_keyboard -defer time
-wait time -wait_ui factor -nowait_bog
-slow_fb time -readtimeout n -nap
-nonap -sb time -nofbpm
-fbpm -noxdamage -xd_area A
-xd_mem f -sigpipe string -threads
-nothreads -fs f -gaps n
-grow n -fuzz n -debug_tiles
-snapfb -rawfb string -freqtab file
-pipeinput cmd -gui [gui-opts] -remote command
-query variable -QD variable -sync
-noremote -yesremote -unsafe
-safer -privremote -nocmds
-allowedcmds list -deny_all
libvncserver options:
-rfbport port TCP port for RFB protocol
@ -7294,7 +7294,7 @@ libvncserver-tight-extension options:
% 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.)
@ -9457,6 +9457,9 @@ Options:
means to act as though there is always user input.
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
are used to optimize scheduling (e.g. -pointer_mode
4, -wireframe, -scrollcopyrect) and other things.
@ -9613,13 +9616,19 @@ Options:
For shared memory segments string is of the
form: "shm:N@WxHxB" which specifies a shmid
N and framebuffer Width, Height, and Bits
per pixel. To memory map mmap(2) a file use:
"map:/path/to/a/file@WxHxB". If there is trouble
with mmap, use "file:/..." for slower lseek(2) based
reading. 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.
per pixel.
For file polling to memory map mmap(2) a file use:
"map:/path/to/a/file@WxHxB", with WxHxB as above.
"mmap:..." is the same. If there is trouble with mmap,
use "file:/..." for slower lseek(2) based reading.
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"
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
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
(and possibly set) the framebuffer parameters.
If the strings begins with "cons", see the linux
console discussion below where the framebuffer device
is opened and keystrokes are inserted into the console.
If the string begins with "cons", "/dev/fb", or
"fb", see the LINUX CONSOLE discussion below where
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
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)
All user input is discarded by default (but see the
-pipeinput option). Most of the X11 (screen, keyboard,
mouse) options do not make sense and many will cause
this mode to crash, so please think twice before
setting or changing them in a running x11vnc.
In general all user input is discarded by default (see
the -pipeinput option for how to use a helper program
to insert). Most of the X11 (screen, keyboard, mouse)
options do not make sense and many will cause this
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
rawfb mode, prepend a "+" e.g. +file:/dev/fb0...
@ -9676,13 +9687,13 @@ Options:
SNAPFB_RAWFB_RESET=1 as well.
If you want x11vnc to dynamically transform a 24bpp
rawfb to 32bpp (note that this will be slower) use
the -24to32 option. This would be useful for, say,
for a video camera that delivers the pixel data as
rawfb to 32bpp (note that this will be slower) also
supply the -24to32 option. This would be useful for,
say, a video camera that delivers the pixel data as
24bpp packed RGB. This is the default under "video"
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.
The idea is the WxHxB will be extracted from the
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
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
<settings> string they are used verbatim: the device
is not queried for the current values. Otherwise the
device will be queried.
Linux console: If the libvncserver LinuxVNC command is
on your system use that instead of the following method
because it will be faster and more accurate for Linux
text console.
LINUX CONSOLE: If the libvncserver LinuxVNC program
is on your system you may want to use that instead of
the following method because it will be faster and more
accurate for Linux text console.
If the rawfb string begins with "cons" the framebuffer
device /dev/fb0 is opened (this requires the appropriate
kernel modules) and so is /dev/tty0. The latter is
used to inject keystrokes (not all are supported,
but the basic ones are). You will need to be root to
inject keystrokes. /dev/tty0 refers to the active VT,
to indicate one explicitly, use "cons2", etc. using
the VT number. Note you can change VT remotely using
the chvt(1) command. Sometimes switching out and back
corrects the framebuffer. To skip injecting entirely
use "consx".
kernel modules to be installed) and so is /dev/tty0.
The latter is used to inject keystrokes (not all are
supported, but the basic ones are). You will need to
be root to inject keystrokes. /dev/tty0 refers to the
active VT, to indicate one explicitly, use "cons2",
etc. using the VT number.
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 -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
instead of "cons". The latter can be used to specify
a different framebuffer device, e.g. /dev/fb1. If the
name is something nonstandard, use "cons:/dev/foofb"
a different framebuffer device, e.g. /dev/fb1. As a
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
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.
Examples:
-rawfb cons (same as -rawfb console)
-rawfb /dev/fb0 (same)
-rawfb cons3 (force /dev/tty3)
-rawfb consx (no keystrokes)
-rawfb consx (no keystrokes or mouse)
-rawfb console:/dev/nonstd
-rawfb cons -pipeinput UINPUT:accel=1.5
-freqtab file For use with "-rawfb video" for TV tuner devices to
specify station frequencies. Instead of using the built
@ -9826,6 +9856,8 @@ Options:
value is stored in X11VNC_RAWFB_STR for the pipe command
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
video capture device, then an internal list of keyboard
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
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
control options -remote/-query described below.
@ -10166,6 +10248,8 @@ n
reset_record reset RECORD extension (if avail.)
pointer_mode:n set -pointer_mode to n. same as "pm"
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.
wmdt:str set -wmdt to str.
debug_pointer enable -debug_pointer, same as "dp"
@ -10195,6 +10279,8 @@ n
snapfb enable -snapfb mode.
nosnapfb disable -snapfb mode.
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
height parameter to n.
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
the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions):
ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid waitmapped
nowaitmapped clip flashcmap noflashcmap shiftcmap
@ -10299,16 +10384,17 @@ n
nodragging wireframe_mode wireframe wf nowireframe
nowf wirecopyrect wcr nowirecopyrect nowcr scr_area
scr_skip scr_inc scr_keys scr_term scr_keyrepeat
scr_parms scrollcopyrect scr noscrollcopyrect noscr
fixscreen noxrecord xrecord reset_record pointer_mode
pm input_skip input grabkbd nograbkbd grabptr
nograbptr client_input speeds wmdt debug_pointer dp
nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
nodk deferupdate defer wait_ui wait_bog nowait_bog
slow_fb wait readtimeout nap nonap sb screen_blank
fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb
progressive rfbport http nohttp httpport httpdir
enablehttpproxy noenablehttpproxy alwaysshared
scr_parms scrollcopyrect scr noscrollcopyrect
noscr fixscreen noxrecord xrecord reset_record
pointer_mode pm input_skip allinput noallinput input
grabkbd nograbkbd grabptr nograbptr client_input
speeds wmdt debug_pointer dp nodebug_pointer nodp
debug_keyboard dk nodebug_keyboard nodk deferupdate
defer wait_ui wait_bog nowait_bog slow_fb wait
readtimeout nap nonap sb screen_blank fbpm nofbpm
fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel
uinput_reset progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage
@ -10333,7 +10419,6 @@ n
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
rfbauth passwd viewpasswd
-QD variable Just like -query variable, but returns the default
value for that parameter (no running x11vnc server
is consulted)

@ -2192,6 +2192,9 @@ void print_help(int mode) {
" means to act as though there is always user input.\n"
" Default: %d\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"
" are used to optimize scheduling (e.g. -pointer_mode\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"
" form: \"shm:N@WxHxB\" which specifies a shmid\n"
" N and framebuffer Width, Height, and Bits\n"
" per pixel. To memory map mmap(2) a file use:\n"
" \"map:/path/to/a/file@WxHxB\". If there is trouble\n"
" with mmap, use \"file:/...\" for slower lseek(2) based\n"
" reading. Use \"snap:...\" to imply -snapfb mode and the\n"
" \"file:\" access (this is for devices that only provide\n"
" the fb all at once). If you do not supply a type \"map\"\n"
" is assumed if the file exists.\n"
" per pixel.\n"
"\n"
" For file polling to memory map mmap(2) a file use:\n"
" \"map:/path/to/a/file@WxHxB\", with WxHxB as above.\n"
" \"mmap:...\" is the same. If there is trouble with mmap,\n"
" use \"file:/...\" for slower lseek(2) based reading.\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"
" If string is \"setup:cmd\", then the command \"cmd\"\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"
" so take care.\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"
" (and possibly set) the framebuffer parameters.\n"
"\n"
" If the strings begins with \"cons\", see the linux\n"
" console discussion below where the framebuffer device\n"
" is opened and keystrokes are inserted into the console.\n"
" If the string begins with \"cons\", \"/dev/fb\", or\n"
" \"fb\", see the LINUX CONSOLE discussion below where\n"
" the framebuffer device is opened and keystrokes (and\n"
" possibly mouse events) are inserted into the console.\n"
"\n"
" Optional suffixes are \":R/G/B\" and \"+O\" to specify\n"
" red, green, and blue masks and an offset into the\n"
@ -2388,11 +2398,12 @@ void print_help(int mode) {
"\n"
" (see ipcs(1) and fbset(1) for the first two examples)\n"
"\n"
" All user input is discarded by default (but see the\n"
" -pipeinput option). Most of the X11 (screen, keyboard,\n"
" mouse) options do not make sense and many will cause\n"
" this mode to crash, so please think twice before\n"
" setting or changing them in a running x11vnc.\n"
" In general all user input is discarded by default (see\n"
" the -pipeinput option for how to use a helper program\n"
" to insert). Most of the X11 (screen, keyboard, mouse)\n"
" options do not make sense and many will cause this\n"
" mode to crash, so please think twice before setting or\n"
" changing them in a running x11vnc.\n"
"\n"
" If you DO NOT want x11vnc to close the X DISPLAY in\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"
"\n"
" If you want x11vnc to dynamically transform a 24bpp\n"
" rawfb to 32bpp (note that this will be slower) use\n"
" the -24to32 option. This would be useful for, say,\n"
" for a video camera that delivers the pixel data as\n"
" rawfb to 32bpp (note that this will be slower) also\n"
" supply the -24to32 option. This would be useful for,\n"
" say, a video camera that delivers the pixel data as\n"
" 24bpp packed RGB. This is the default under \"video\"\n"
" mode if the bpp is 24.\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"
" The idea is the WxHxB will be extracted from the\n"
" device itself. So if you do not supply \"@WxHxB...\n"
@ -2495,44 +2506,63 @@ void print_help(int mode) {
"\n"
" See the -pipeinput VID option below for a way to control\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"
" As above, if you specify a \"@WxHxB...\" after the\n"
" <settings> string they are used verbatim: the device\n"
" is not queried for the current values. Otherwise the\n"
" device will be queried.\n"
"\n"
" Linux console: If the libvncserver LinuxVNC command is\n"
" on your system use that instead of the following method\n"
" because it will be faster and more accurate for Linux\n"
" text console.\n"
" LINUX CONSOLE: If the libvncserver LinuxVNC program\n"
" is on your system you may want to use that instead of\n"
" the following method because it will be faster and more\n"
" accurate for Linux text console.\n"
"\n"
" If the rawfb string begins with \"cons\" the framebuffer\n"
" device /dev/fb0 is opened (this requires the appropriate\n"
" kernel modules) and so is /dev/tty0. The latter is\n"
" used to inject keystrokes (not all are supported,\n"
" but the basic ones are). You will need to be root to\n"
" inject keystrokes. /dev/tty0 refers to the active VT,\n"
" to indicate one explicitly, use \"cons2\", etc. using\n"
" the VT number. Note you can change VT remotely using\n"
" the chvt(1) command. Sometimes switching out and back\n"
" corrects the framebuffer. To skip injecting entirely\n"
" use \"consx\".\n"
" kernel modules to be installed) and so is /dev/tty0.\n"
" The latter is used to inject keystrokes (not all are\n"
" supported, but the basic ones are). You will need to\n"
" be root to inject keystrokes. /dev/tty0 refers to the\n"
" active VT, to indicate one explicitly, use \"cons2\",\n"
" etc. using the VT number.\n"
"\n"
" If the Linux version seems to be 2.6 or later and the\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"
" The strings \"console\", or \"/dev/fb0\" can be used\n"
" instead of \"cons\". The latter can be used to specify\n"
" a different framebuffer device, e.g. /dev/fb1. If the\n"
" name is something nonstandard, use \"cons:/dev/foofb\"\n"
" a different framebuffer device, e.g. /dev/fb1. As a\n"
" shortcut the \"/dev/\" can be dropped. If the name is\n"
" something nonstandard, use \"cons:/dev/foofb\"\n"
"\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"
"\n"
" Examples:\n"
" -rawfb cons (same as -rawfb console)\n"
" -rawfb /dev/fb0 (same)\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 cons -pipeinput UINPUT:accel=1.5\n"
"\n"
"-freqtab file For use with \"-rawfb video\" for TV tuner devices to\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"
" to use if it wants. Do 'env | grep X11VNC' for more.\n"
"\n"
" Built-in pipeinput modes:\n"
"\n"
" If cmd is \"VID\" and you are using the -rawfb for a\n"
" video capture device, then an internal list of keyboard\n"
" mappings is used to set parameters of the video.\n"
@ -2579,7 +2611,57 @@ void print_help(int mode) {
"\n"
" If cmd is \"CONS\" or \"CONSn\" where n is a Linux\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"
"-gui [gui-opts] Start up a simple tcl/tk gui based on the the remote\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"
" pointer_mode:n set -pointer_mode to n. same as \"pm\"\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"
" wmdt:str set -wmdt to str.\n"
" debug_pointer enable -debug_pointer, same as \"dp\"\n"
@ -2936,6 +3020,8 @@ void print_help(int mode) {
" snapfb enable -snapfb mode.\n"
" nosnapfb disable -snapfb mode.\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"
" height parameter to n.\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"
" the returned value corresponds to (hint: the ext_*\n"
" variables correspond to the presence of X extensions):\n"
"\n"
" ans= stop quit exit shutdown ping blacken zero\n"
" refresh reset close disconnect id sid waitmapped\n"
" nowaitmapped clip flashcmap noflashcmap shiftcmap\n"
@ -3040,16 +3125,17 @@ void print_help(int mode) {
" nodragging wireframe_mode wireframe wf nowireframe\n"
" nowf wirecopyrect wcr nowirecopyrect nowcr scr_area\n"
" scr_skip scr_inc scr_keys scr_term scr_keyrepeat\n"
" scr_parms scrollcopyrect scr noscrollcopyrect noscr\n"
" fixscreen noxrecord xrecord reset_record pointer_mode\n"
" pm input_skip input grabkbd nograbkbd grabptr\n"
" nograbptr client_input speeds wmdt debug_pointer dp\n"
" nodebug_pointer nodp debug_keyboard dk nodebug_keyboard\n"
" nodk deferupdate defer wait_ui wait_bog nowait_bog\n"
" slow_fb wait readtimeout nap nonap sb screen_blank\n"
" fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb\n"
" progressive rfbport http nohttp httpport httpdir\n"
" enablehttpproxy noenablehttpproxy alwaysshared\n"
" scr_parms scrollcopyrect scr noscrollcopyrect\n"
" noscr fixscreen noxrecord xrecord reset_record\n"
" pointer_mode pm input_skip allinput noallinput input\n"
" grabkbd nograbkbd grabptr nograbptr client_input\n"
" speeds wmdt debug_pointer dp nodebug_pointer nodp\n"
" debug_keyboard dk nodebug_keyboard nodk deferupdate\n"
" defer wait_ui wait_bog nowait_bog slow_fb wait\n"
" readtimeout nap nonap sb screen_blank fbpm nofbpm\n"
" fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel\n"
" uinput_reset progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n"
" nodontdisconnect desktop debug_xevents nodebug_xevents\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"
" wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y coff_x coff_y\n"
" rfbauth passwd viewpasswd\n"
"\n"
"-QD variable Just like -query variable, but returns the default\n"
" value for that parameter (no running x11vnc server\n"
" is consulted)\n"

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

@ -6,6 +6,7 @@
#include "xinerama.h"
#include "screen.h"
#include "pointer.h"
#include "allowed_input_t.h"
#if LIBVNCSERVER_HAVE_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 *q, *in = strdup(str);
char *atparms = NULL, *file = NULL;
int tty = -1;
int do_input, have_uinput, tty = -1;
if (strstr(in, "/dev/fb") == in) {
free(in);
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);
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: */
if (! have_uinput) {
tty = 0;
}
} else {
int n;
if (sscanf(in, "cons%d", &n) == 1) {
tty = n;
have_uinput = 0;
} else if (sscanf(in, "console%d", &n) != 1) {
tty = n;
have_uinput = 0;
}
}
if (do_input) {
if (tty >=0 && tty < 64) {
if (pipeinput_str == NULL) {
pipeinput_str = (char *) malloc(10);
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();
}
}
@ -143,10 +166,20 @@ char *console_guess(char *str, int *fd) {
void console_key_command(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
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 (pipeinput_cons_fd < 0) {
return;
}
if (view_only) {
return;
}
get_allowed_input(client, &input);
if (! input.keystroke) {
return;
}
/* From LinuxVNC.c: */
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) {
/* do not forget viewonly perms */
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 napmax = 1500; /* longest nap in ms. */
int ui_skip = 10; /* see watchloop. negative means ignore input */
int all_input = 0;
#if LIBVNCSERVER_HAVE_FBPM

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

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

@ -43,7 +43,6 @@ typedef struct ptrremap {
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
MUTEX(pointerMutex);
#endif
#define MAX_BUTTONS 5
#define MAX_BUTTON_EVENTS 50
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) {
v4l_pointer_command(mask, x, y, client);
}
if (pipeinput_int == PIPEINPUT_CONS) {
} else if (pipeinput_int == PIPEINPUT_CONS) {
console_pointer_command(mask, x, y, client);
} else if (pipeinput_int == PIPEINPUT_UINPUT) {
uinput_pointer_command(mask, x, y, client);
}
if (pipeinput_fh == NULL) {
return;
@ -536,6 +536,7 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
can_input = 1; /* XXX distinguish later */
}
}
if (cd) {
uid = cd->uid;
}
@ -594,6 +595,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
if (mask >= 0) {
got_pointer_calls++;
}
get_allowed_input(client, &input);
if (debug_pointer && mask >= 0) {
static int show_motion = -1;
@ -631,7 +633,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
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);
if (! pipeinput_tee) {
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++;
last_pointer_client = client;
}
if (view_only && raw_fb) {
if (input.motion) {
/* raw_fb hack track button state */
button_mask_prev = button_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()
* to flush the event queue; there is no real pointer event.
*/
get_allowed_input(client, &input);
if (! input.motion && ! input.button) {
return;
}
@ -863,7 +864,7 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
}
void initialize_pipeinput(void) {
char *p;
char *p = NULL;
if (pipeinput_fh != NULL) {
rfbLog("closing pipeinput stream: %p\n", pipeinput_fh);
@ -882,7 +883,11 @@ void initialize_pipeinput(void) {
}
/* look for options: tee, reopen, ... */
if (strstr(pipeinput_str, "UINPUT") == pipeinput_str) {
;
} else {
p = strchr(pipeinput_str, ':');
}
if (p != NULL) {
char *str, *opt, *q;
int got = 0;
@ -919,8 +924,7 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
if (!strcmp(p, "VID")) {
pipeinput_int = PIPEINPUT_VID;
return;
}
if (strstr(p, "CONS") == p) {
} else if (strstr(p, "CONS") == p) {
int tty = 0, n;
char dev[32];
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");
}
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();
@ -990,16 +1002,16 @@ if (0) fprintf(stderr, "initialize_pipeinput: %s -- %s\n", pipeinput_str, p);
"# It can be:\n"
"#\n"
"# None (nothing to report)\n"
"# ButtonPress-N (this event will cause button-1 to be pressed) \n"
"# ButtonRelease-N (this event will cause button-1 to be released) \n"
"# ButtonPress-N (this event will cause button-N to be pressed) \n"
"# ButtonRelease-N (this event will cause button-N to be released) \n"
"#\n"
"# if two more more buttons change state in one event they are listed\n"
"# separated by commas.\n"
"#\n"
"# One might parse a Pointer line with:\n"
"#\n"
"# int client, x, y, mask; char *hint;\n"
"# sscanf(line, \"Pointer %d %d %d %s\", &client, &x, &y, &mask, &hint);\n"
"# int client, x, y, mask; char hint[100];\n"
"# sscanf(line, \"Pointer %d %d %d %d %s\", &client, &x, &y, &mask, hint);\n"
"#\n"
"#\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"
"# One might parse a Keysym line with:\n"
"#\n"
"# int client, down, keysym; char *name, *hint;\n"
"# sscanf(line, \"Keysym %d %d %s %s\", &client, &down, &keysym, &name, &hint);\n"
"# int client, down, keysym; char name[100], hint[100];\n"
"# sscanf(line, \"Keysym %d %d %d %s %s\", &client, &down, &keysym, name, hint);\n"
"#\n"
"# The <hint> value is currently just None, KeyPress, or KeyRelease.\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"
"# both sides helps).\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"
"# end of this informational text:\n"
"# END_OF_TOP\n"

@ -24,6 +24,7 @@
#include "keyboard.h"
#include "selection.h"
#include "unixpw.h"
#include "uinput.h"
int send_remote_cmd(char *cmd, int query, int wait);
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);
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) {
int doit = 1;
COLON_CHECK("input:")
@ -3436,6 +3452,28 @@ char *process_remote_cmd(char *cmd, int stringonly) {
do_new_fb(1);
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) {
int f;
COLON_CHECK("progressive:")

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

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

@ -189,6 +189,8 @@ char gui_code[] = "";
" visual:\n"
" rawfb:\n"
" pipeinput:\n"
" uinput_accel:\n"
" uinput_reset:\n"
" 24to32\n"
" =GAL LOFF\n"
"\n"
@ -328,6 +330,7 @@ char gui_code[] = "";
"Tuning\n"
" =D-C:0,1,2,3,4 pointer_mode:\n"
" input_skip:\n"
" allinput\n"
" =D nodragging\n"
" -- D\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,8 +446,25 @@ void rfbCFD(long usec) {
}
if (! use_threads) {
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_in_rfbPE) {

@ -6,6 +6,7 @@
#include "xinerama.h"
#include "screen.h"
#include "connections.h"
#include "allowed_input_t.h"
#if LIBVNCSERVER_HAVE_LINUX_VIDEODEV_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) {
allowed_input_t input;
if (raw_fb_fd < 0) {
return;
}
if (! down) {
return;
}
if (view_only) {
return;
}
get_allowed_input(client, &input);
if (! input.keystroke) {
return;
}
if (keysym == XK_b) {
v4l_br(-1);
} 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) {
/* do not forget viewonly perms */
if (mask || x || y || client) {}
}

@ -2,7 +2,7 @@
.TH X11VNC "1" "July 2006" "x11vnc " "User Commands"
.SH NAME
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
.B x11vnc
[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.
Default: 10
.PP
\fB-allinput\fR
.IP
Have x11vnc read and process all available client input
before proceeding.
.PP
\fB-speeds\fR \fIrd,bw,lat\fR
.IP
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
form: "shm:N@WxHxB" which specifies a shmid
N and framebuffer Width, Height, and Bits
per pixel. To memory map
per pixel.
.IP
For file polling to memory map
.IR mmap (2)
a file use:
"map:/path/to/a/file@WxHxB". If there is trouble
with mmap, use "file:/..." for slower
"map:/path/to/a/file@WxHxB", with WxHxB as above.
"mmap:..." is the same. If there is trouble with mmap,
use "file:/..." for slower
.IR lseek (2)
based
reading. Use "snap:..." to imply \fB-snapfb\fR 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.
based reading.
Use "snap:..." to imply \fB-snapfb\fR mode and the "file:"
access (this is for devices that only provide the fb
all at once).
.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
If string is "setup:cmd", then the command "cmd"
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
so take care.
.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
(and possibly set) the framebuffer parameters.
.IP
If the strings begins with "cons", see the linux
console discussion below where the framebuffer device
is opened and keystrokes are inserted into the console.
If the string begins with "cons", "/dev/fb", or
"fb", see the LINUX CONSOLE discussion below where
the framebuffer device is opened and keystrokes (and
possibly mouse events) are inserted into the console.
.IP
Optional suffixes are ":R/G/B" and "+O" to specify
red, green, and blue masks and an offset into the
@ -2847,11 +2859,12 @@ and
.IR fbset (1)
for the first two examples)
.IP
All user input is discarded by default (but see the
\fB-pipeinput\fR option). Most of the X11 (screen, keyboard,
mouse) options do not make sense and many will cause
this mode to crash, so please think twice before
setting or changing them in a running x11vnc.
In general all user input is discarded by default (see
the \fB-pipeinput\fR option for how to use a helper program
to insert). Most of the X11 (screen, keyboard, mouse)
options do not make sense and many will cause this
mode to crash, so please think twice before setting or
changing them in a running x11vnc.
.IP
If you DO NOT want x11vnc to close the X DISPLAY in
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.
.IP
If you want x11vnc to dynamically transform a 24bpp
rawfb to 32bpp (note that this will be slower) use
the \fB-24to32\fR option. This would be useful for, say,
for a video camera that delivers the pixel data as
rawfb to 32bpp (note that this will be slower) also
supply the \fB-24to32\fR option. This would be useful for,
say, a video camera that delivers the pixel data as
24bpp packed RGB. This is the default under "video"
mode if the bpp is 24.
.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.
The idea is the WxHxB will be extracted from the
device itself. So if you do not supply "@WxHxB...
@ -2956,46 +2969,64 @@ all of the above settings.
.IP
See the \fB-pipeinput\fR VID option below for a way to control
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
As above, if you specify a "@WxHxB..." after the
<settings> string they are used verbatim: the device
is not queried for the current values. Otherwise the
device will be queried.
.IP
Linux console: If the libvncserver LinuxVNC command is
on your system use that instead of the following method
because it will be faster and more accurate for Linux
text console.
LINUX CONSOLE: If the libvncserver LinuxVNC program
is on your system you may want to use that instead of
the following method because it will be faster and more
accurate for Linux text console.
.IP
If the rawfb string begins with "cons" the framebuffer
device /dev/fb0 is opened (this requires the appropriate
kernel modules) and so is /dev/tty0. The latter is
used to inject keystrokes (not all are supported,
but the basic ones are). You will need to be root to
inject keystrokes. /dev/tty0 refers to the active VT,
to indicate one explicitly, use "cons2", etc. using
the VT number. Note you can change VT remotely using
the
kernel modules to be installed) and so is /dev/tty0.
The latter is used to inject keystrokes (not all are
supported, but the basic ones are). You will need to
be root to inject keystrokes. /dev/tty0 refers to the
active VT, to indicate one explicitly, use "cons2",
etc. using the VT number.
.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)
command. Sometimes switching out and back
corrects the framebuffer. To skip injecting entirely
use "consx".
command. Sometimes switching out and back corrects
the framebuffer state.
.IP
To skip input injecting entirely use "consx".
.IP
The strings "console", or "/dev/fb0" can be used
instead of "cons". The latter can be used to specify
a different framebuffer device, e.g. /dev/fb1. If the
name is something nonstandard, use "cons:/dev/foofb"
a different framebuffer device, e.g. /dev/fb1. As a
shortcut the "/dev/" can be dropped. If the name is
something nonstandard, use "cons:/dev/foofb"
.IP
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.
.IP
Examples:
\fB-rawfb\fR cons (same as \fB-rawfb\fR console)
\fB-rawfb\fR /dev/fb0 (same)
\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 cons \fB-pipeinput\fR UINPUT:accel=1.5
.PP
\fB-freqtab\fR \fIfile\fR
.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
to use if it wants. Do 'env | grep X11VNC' for more.
.IP
Built-in pipeinput modes:
.IP
If cmd is "VID" and you are using the \fB-rawfb\fR for a
video capture device, then an internal list of keyboard
mappings is used to set parameters of the video.
@ -3046,7 +3079,59 @@ GREY respectively. See \fB-rawfb\fR video for details.
.IP
If cmd is "CONS" or "CONSn" where n is a Linux
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
\fB-gui\fR \fI[gui-opts]\fR
.IP
@ -3526,6 +3611,10 @@ pointer_mode:n set \fB-pointer_mode\fR to n. same as "pm"
.IP
input_skip:n set \fB-input_skip\fR to n.
.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.
.IP
wmdt:str set \fB-wmdt\fR to str.
@ -3584,6 +3673,10 @@ nosnapfb disable \fB-snapfb\fR mode.
.IP
rawfb:str set \fB-rawfb\fR mode to "str".
.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
height parameter to n.
.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
the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions):
.IP
ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid waitmapped
nowaitmapped clip flashcmap noflashcmap shiftcmap
@ -3734,16 +3826,17 @@ xwarp noxwarppointer noxwarp buttonmap dragging
nodragging wireframe_mode wireframe wf nowireframe
nowf wirecopyrect wcr nowirecopyrect nowcr scr_area
scr_skip scr_inc scr_keys scr_term scr_keyrepeat
scr_parms scrollcopyrect scr noscrollcopyrect noscr
fixscreen noxrecord xrecord reset_record pointer_mode
pm input_skip input grabkbd nograbkbd grabptr
nograbptr client_input speeds wmdt debug_pointer dp
nodebug_pointer nodp debug_keyboard dk nodebug_keyboard
nodk deferupdate defer wait_ui wait_bog nowait_bog
slow_fb wait readtimeout nap nonap sb screen_blank
fbpm nofbpm fs gaps grow fuzz snapfb nosnapfb rawfb
progressive rfbport http nohttp httpport httpdir
enablehttpproxy noenablehttpproxy alwaysshared
scr_parms scrollcopyrect scr noscrollcopyrect
noscr fixscreen noxrecord xrecord reset_record
pointer_mode pm input_skip allinput noallinput input
grabkbd nograbkbd grabptr nograbptr client_input
speeds wmdt debug_pointer dp nodebug_pointer nodp
debug_keyboard dk nodebug_keyboard nodk deferupdate
defer wait_ui wait_bog nowait_bog slow_fb wait
readtimeout nap nonap sb screen_blank fbpm nofbpm
fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel
uinput_reset progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents
debug_xevents debug_xdamage nodebug_xdamage

@ -2073,6 +2073,10 @@ int main(int argc, char* argv[]) {
CHECK_ARGC
ui_skip = atoi(argv[++i]);
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")) {
CHECK_ARGC
speeds_str = strdup(argv[++i]);

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* 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 */

Loading…
Cancel
Save