Commit 0abd329d authored by runge's avatar runge

x11vnc: more UINPUT mode tweaks.

parent 0afa1da8
2006-07-11 Karl Runge <runge@karlrunge.com>
* x11vnc: more tweaks to UINPUT, mostly mouse motion.
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)
......
This diff is collapsed.
......@@ -2528,16 +2528,17 @@ void print_help(int mode) {
" 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"
" If the Linux version seems to be 2.6 or later and\n"
" the \"uinput\" module appears to be present, then\n"
" the uinput method will be used instead of /dev/ttyN.\n"
" uinput allows insertion of BOTH keystrokes and mouse\n"
" input and so it preferred when accessing graphical\n"
" (e.g. QT-embedded) linux console apps. See -pipeinput\n"
" UINPUT below for more information on this mode; you\n"
" will have to use -pipeinput if you want to tweak any\n"
" UINPUT parameters. You may also want to also use the\n"
" -nodragging and -cursor none options. Use \"cons0\",\n"
" etc or -pipeinput CONS to force the /dev/ttyN method.\n"
"\n"
" Note you can change VT remotely using the chvt(1)\n"
" command. Sometimes switching out and back corrects\n"
......@@ -2591,7 +2592,7 @@ 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"
" Built-in pipeinput modes (no external program required):\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"
......@@ -2655,16 +2656,25 @@ void print_help(int mode) {
" 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\n"
" number of ms (default 500) after which the cursor is\n"
" number of ms (default 150) after which the cursor is\n"
" attempted to be reset (by forcing the mouse to (0,\n"
" 0) via small increments and then back out to (x, y)\n"
" in 1 jump), This correction seems to be needed but can\n"
" cause jerkiness or unexpected behavior with menus, etc.\n"
" Use reset=0 to disable.\n"
"\n"
" If you set the env. var X11VNC_UINPUT_THRESHOLDS then\n"
" the thresh=n mode will be enabled. It it currently\n"
" not working well. If |dx| <= thresh and |dy| < thresh\n"
" no acceleration is applied. Use \"thresh=+n\" |dx| +\n"
" |dy| <= thresh to be used instead (X11?)\n"
"\n"
" Example:\n"
" -pipeinput UINPUT:accel=4.0 -cursor none\n"
"\n"
" You can also set the env. var X11VNC_UINPUT_DEBUG=1 or\n"
" higher to get debugging output for UINPUT mode.\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"
" Requires the \"wish\" program to be installed on the\n"
......@@ -3024,6 +3034,7 @@ void print_help(int mode) {
" 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"
" uinput_always:n set uinput_always to 1/0.\n"
" progressive:n set libvncserver -progressive slice\n"
" height parameter to n.\n"
" desktop:str set -desktop name to str for new clients.\n"
......@@ -3090,13 +3101,6 @@ void print_help(int mode) {
" query straight to the X11VNC_REMOTE property or connect\n"
" file use \"qry=...\" instead of \"cmd=...\"\n"
"\n"
" Here is the current list of \"variables\" that can\n"
" be supplied to the -query command. This includes the\n"
" \"N/A\" ones that return no useful info. For variables\n"
" names that do not correspond to an x11vnc option or\n"
" 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"
" ans= stop quit exit shutdown ping blacken zero\n"
" refresh reset close disconnect id sid waitmapped\n"
" nowaitmapped clip flashcmap noflashcmap shiftcmap\n"
......@@ -3127,16 +3131,16 @@ 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\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"
" scr_parms scrollcopyrect scr noscrollcopyrect noscr\n"
" fixscreen noxrecord xrecord reset_record pointer_mode\n"
" pm input_skip allinput noallinput input grabkbd\n"
" nograbkbd grabptr nograbptr client_input speeds wmdt\n"
" debug_pointer dp nodebug_pointer nodp debug_keyboard\n"
" dk nodebug_keyboard nodk deferupdate defer wait_ui\n"
" wait_bog nowait_bog slow_fb wait readtimeout nap\n"
" nonap sb screen_blank fbpm nofbpm fs gaps grow\n"
" fuzz snapfb nosnapfb rawfb uinput_accel uinput_reset\n"
" uinput_always progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n"
" nodontdisconnect desktop debug_xevents nodebug_xevents\n"
......@@ -3162,6 +3166,7 @@ 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"
......
......@@ -2631,6 +2631,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
static rfbKeySym last_keysym = NoSymbol;
static rfbKeySym max_keyrepeat_last_keysym = NoSymbol;
static double max_keyrepeat_last_time = 0.0;
static double max_keyrepeat_always = -1.0;
dtime0(&tnow);
got_keyboard_calls++;
......@@ -2645,6 +2646,7 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
unixpw_in_progress, tnow - x11vnc_start);
}
if (keysym <= 0) {
rfbLog("keyboard: skipping 0x0 keysym\n");
return;
......@@ -2768,6 +2770,18 @@ void keyboard(rfbBool down, rfbKeySym keysym, rfbClientPtr client) {
}
}
#ifdef MAX_KEYREPEAT
if (max_keyrepeat_always < 0.0) {
if (getenv("MAX_KEYREPEAT")) {
max_keyrepeat_always = atof(getenv("MAX_KEYREPEAT"));
} else {
max_keyrepeat_always = 0.0;
}
}
if (max_keyrepeat_always > 0.0) {
max_keyrepeat_time = max_keyrepeat_always;
}
#endif
if (!down && skipped_last_down) {
int db = debug_scroll;
if (keysym == max_keyrepeat_last_keysym) {
......
......@@ -3463,6 +3463,17 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("set_uinput_accel: %s\n", p);
set_uinput_accel(p);
} else if (strstr(p, "uinput_thresh") == p) {
COLON_CHECK("uinput_thresh:")
if (query) {
snprintf(buf, bufn, "ans=%s%s%s", p, co,
NONUL(get_uinput_thresh()));
goto qry;
}
p += strlen("uinput_thresh:");
rfbLog("set_uinput_thresh: %s\n", p);
set_uinput_thresh(p);
} else if (strstr(p, "uinput_reset") == p) {
COLON_CHECK("uinput_reset:")
p += strlen("uinput_reset:");
......@@ -3474,6 +3485,17 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("set_uinput_reset: %s\n", p);
set_uinput_reset(atoi(p));
} else if (strstr(p, "uinput_always") == p) {
COLON_CHECK("uinput_always:")
p += strlen("uinput_always:");
if (query) {
snprintf(buf, bufn, "ans=%s%s%d", p, co,
get_uinput_always());
goto qry;
}
rfbLog("set_uinput_always: %s\n", p);
set_uinput_always(atoi(p));
} else if (strstr(p, "progressive") == p) {
int f;
COLON_CHECK("progressive:")
......
......@@ -180,6 +180,7 @@ Screen
pipeinput:
uinput_accel:
uinput_reset:
uinput_always:
24to32
=GAL LOFF
......
......@@ -191,6 +191,7 @@ char gui_code[] = "";
" pipeinput:\n"
" uinput_accel:\n"
" uinput_reset:\n"
" uinput_always:\n"
" 24to32\n"
" =GAL LOFF\n"
"\n"
......
This diff is collapsed.
......@@ -6,9 +6,13 @@
extern int check_uinput(void);
extern int initialize_uinput(void);
extern int set_uinput_accel(char *str);
extern int set_uinput_thresh(char *str);
extern void set_uinput_reset(int ms);
extern void set_uinput_always(int);
extern char *get_uinput_accel();
extern char *get_uinput_thresh();
extern int get_uinput_reset();
extern int get_uinput_always();
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);
......
......@@ -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-09
version: 0.8.2, lastmod: 2006-07-11
.SH SYNOPSIS
.B x11vnc
[OPTION]...
......@@ -2991,16 +2991,17 @@ 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.
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
will have to use \fB-pipeinput\fR if you want to tweak any
UINPUT parameters. You may also 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)
......@@ -3059,7 +3060,7 @@ 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:
Built-in pipeinput modes (no external program required):
.IP
If cmd is "VID" and you are using the \fB-rawfb\fR for a
video capture device, then an internal list of keyboard
......@@ -3125,15 +3126,24 @@ will get out of sync (probably due to a mouse
apply, set
.IR xset (1)
). The option reset=N sets the
number of ms (default 500) after which the cursor is
number of ms (default 150) 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 with menus, etc.
Use reset=0 to disable.
.IP
If you set the env. var X11VNC_UINPUT_THRESHOLDS then
the thresh=n mode will be enabled. It it currently
not working well. If |dx| <= thresh and |dy| < thresh
no acceleration is applied. Use "thresh=+n" |dx| +
|dy| <= thresh to be used instead (X11?)
.IP
Example:
\fB-pipeinput\fR UINPUT:accel=4.0 \fB-cursor\fR none
.IP
You can also set the env. var X11VNC_UINPUT_DEBUG=1 or
higher to get debugging output for UINPUT mode.
.PP
\fB-gui\fR \fI[gui-opts]\fR
.IP
......@@ -3679,6 +3689,8 @@ uinput_accel:f set uinput_accel to f.
.IP
uinput_reset:n set uinput_reset to n ms.
.IP
uinput_always:n set uinput_always to 1/0.
.IP
progressive:n set libvncserver \fB-progressive\fR slice
height parameter to n.
.IP
......@@ -3791,13 +3803,6 @@ these cases the value returned is "N/A". To direct a
query straight to the X11VNC_REMOTE property or connect
file use "qry=..." instead of "cmd=..."
.IP
Here is the current list of "variables" that can
be supplied to the \fB-query\fR command. This includes the
"N/A" ones that return no useful info. For variables
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):
ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid waitmapped
nowaitmapped clip flashcmap noflashcmap shiftcmap
......@@ -3828,16 +3833,16 @@ 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 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
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
uinput_always progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop debug_xevents nodebug_xevents
......
......@@ -19,7 +19,7 @@
* USA.
*
*
* This program is based heavily on the following programs:
* This program is based on the following programs:
*
* the originial x11vnc.c in libvncserver (Johannes E. Schindelin)
* x0rfbserver, the original native X vnc server (Jens Wagner)
......
......@@ -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-09";
char lastmod[] = "0.8.2 lastmod: 2006-07-11";
/* X display info */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment