"-xwarppointer          Move the pointer with XWarpPointer(3X) instead of XTEST\n" "                       extension.  Use this as a workaround if the pointer\n" "                       motion behaves incorrectly, e.g.  on touchscreens or\n" "                       other non-standard setups.  Also sometimes needed on\n" "                       XINERAMA displays.\n"
"-xwarppointer          Move the pointer with XWarpPointer(3X) instead of\n" "                       the XTEST extension.  Use this as a workaround\n" "                       if the pointer motion behaves incorrectly, e.g.\n" "                       on touchscreens or other non-standard setups.\n" "                       Also sometimes needed on XINERAMA displays.\n"
static void print_help(void) {	char help[] = "\n""x11vnc: allow VNC connections to real X11 displays. %s\n""\n""Typical usage is:\n""\n""   Run this command in a shell on the remote machine \"far-host\"\n""   with X session you wish to view:\n""\n""       x11vnc -display :0\n""\n""   Then run this in another window on the machine you are sitting at:\n""\n""       vncviewer far-host:0\n""\n""Once x11vnc establishes connections with the X11 server and starts\n""listening as a VNC server it will print out a string: PORT=XXXX where\n""XXXX is typically 5900 (the default VNC port).  One would next run something\n""like this on the local machine: \"vncviewer host:N\" where N is XXXX - 5900,\n""i.e. usually \"vncviewer host:0\"\n""\n""By default x11vnc will not allow the screen to be shared and it will\n""exit as soon as a client disconnects.  See -shared and -forever below\n""to override these protections.\n""\n""For additional info see: http://www.karlrunge.com/x11vnc/\n""                    and  http://www.karlrunge.com/x11vnc/#faq\n""\n""\n""Rudimentary config file support: if the file $HOME/.x11vncrc exists then each\n""line in it is treated as a single command line option.  Disable with -norc.\n""For each option name, the leading character \"-\" is not required.  E.g. a\n""line that is either \"nap\" or \"-nap\" may be used and are equivalent.\n""Likewise \"wait 100\" or \"-wait 100\" are acceptable and equivalent lines.\n""The \"#\" character comments out to the end of the line in the usual way.\n""Leading and trailing whitespace is trimmed off.  Lines may be continued with\n""a \"\\\" as the last character of a line (it becomes a space character).\n""\n""Options:\n""\n""-display disp          X11 server display to connect to, usually :0.  The X\n""                       server process must be running on same machine and\n""                       support MIT-SHM.  Equivalent to setting the DISPLAY\n""                       environment variable to \"disp\".\n""-auth file             Set the X authority file to be \"file\", equivalent to\n""                       setting the XAUTHORITY environment varirable to \"file\"\n""                       before startup.  See Xsecurity(7), xauth(1) man pages.\n""\n""-id windowid           Show the window corresponding to \"windowid\" not\n""                       the entire display.  New windows like popup menus,\n""                       etc may not be seen, or will be clipped.  x11vnc may\n""                       crash if the window changes size, is iconified, etc.\n""                       Use xwininfo(1) to get the window id.  Primarily useful\n""                       for exporting very simple applications.\n""-sid windowid          As -id, but instead of using the window directly it\n""                       shifts a root view to it: this shows saveUnders menus,\n""                       etc, although they will be clipped if they extend beyond\n""                       the window.\n""-flashcmap             In 8bpp indexed color, let the installed colormap flash\n""                       as the pointer moves from window to window (slow).\n""-notruecolor           For 8bpp displays, force indexed color (i.e. a colormap)\n""                       even if it looks like 8bpp TrueColor. (rare problem)\n""-overlay               Handle multiple depth visuals on one screen, e.g. 8+24\n""                       and 24+8 overlay visuals (the 32 bits per pixel are\n""                       packed with 8 for PseudoColor and 24 for TrueColor).\n""\n""                       Currently -overlay only works on Solaris (it uses\n""                       XReadScreen(3X11)).  There is a problem with image\n""                       \"bleeding\" around transient popup menus (but not\n""                       for the menu itself): a workaround is to disable\n""                       SaveUnders by passing the \"-su\" argument to Xsun\n""                       (in /etc/dt/config/Xservers, say).  Also note that,\n""                       the mouse cursor shape is exactly correct in this mode.\n""\n""                       Use -overlay as a workaround for situations like these:\n""                       Some legacy applications require the default visual\n""                       be 8bpp (8+24), or they will use 8bpp PseudoColor even\n""                       when the default visual is depth 24 TrueColor (24+8).\n""                       In these cases colors in some windows will be messed\n""                       up in x11vnc unless -overlay is used.\n""\n""                       Under -overlay, performance will be somewhat degraded\n""                       due to the extra image transformations required.\n""                       For optimal performance do not use -overlay, but rather\n""                       configure the X server so that the default visual is\n""                       depth 24 TrueColor and try to have all apps use that\n""                       visual (some apps have -use24 or -visual options).\n""-overlay_nocursor      Sets -overlay, but does not try to draw the exact mouse\n""                       cursor shape using the overlay mechanism.\n""-visual n              Experimental option: probably does not do what you\n""                       think.  It simply *forces* the visual used for the\n""                       framebuffer; this may be a bad thing... It is useful for\n""                       testing and for some workarounds.  n may be a decimal\n""                       number, or 0x hex.  Run xdpyinfo(1) for the values.\n""                       One may also use \"TrueColor\", etc. see <X11/X.h>\n""                       for a list.  If the string ends in \":m\" for better\n""                       or for worse the visual depth is forced to be m.\n""\n""-scale fraction        Scale the framebuffer by factor \"fraction\".\n""                       Values less than 1 shrink the fb.  Note: image may not\n""                       be sharp and response may be slower.  Currently the\n""                       cursor shape is not scaled.  If \"fraction\" contains\n""                       a decimal point \".\" it is taken as a floating point\n""                       number, alternatively the notation \"m/n\" may be used\n""                       to denote fractions exactly, e.g. -scale 2/3.\n""\n""                       Scaling Options: can be added after \"fraction\" via\n""                       \":\", to supply multiple \":\" options use commas.\n""                       If you just want a quick, rough scaling without\n""                       blending, append \":nb\" to \"fraction\" (e.g. -scale\n""                       1/3:nb).  For compatibility with vncviewers the scaled\n""                       width is adjusted to be a multiple of 4: to disable\n""                       this use \":n4\".  More esoteric options: \":in\" use\n""                       interpolation scheme even when shrinking, \":pad\",\n""                       pad scaled width and height to be multiples of scaling\n""                       denominator (e.g. 3 for 2/3).\n""\n""-viewonly              All VNC clients can only watch (default %s).\n""-shared                VNC display is shared (default %s).\n""-once                  Exit after the first successfully connected viewer\n""                       disconnects, opposite of -forever. This is the Default.\n""-forever               Keep listening for more connections rather than exiting\n""                       as soon as the first client(s) disconnect. Same as -many\n""-connect string        For use with \"vncviewer -listen\" reverse connections.\n""                       If \"string\" has the form \"host\" or \"host:port\"\n""                       the connection is made once at startup.  Use commas\n""                       for a list of host's and host:port's.  If \"string\"\n""                       contains \"/\" it is instead interpreted as a file to\n""                       periodically check for new hosts.  The first line is\n""                       read and then the file is truncated.\n""-vncconnect            Monitor the VNC_CONNECT X property set by the standard\n""-novncconnect          VNC program vncconnect(1).  When the property is\n""                       set to \"host\" or \"host:port\" establish a reverse\n""                       connection.  Using xprop(1) instead of vncconnect may\n""                       work, see the FAQ.  Default: %s\n""-inetd                 Launched by inetd(1): stdio instead of listening socket.\n""                       Note: if you are not redirecting stderr to a log file\n""                       (via shell 2> or -o option) you must also specify the\n""                       -q option.\n""\n""-allow addr1[,addr2..] Only allow client connections from IP addresses matching\n""                       the comma separated list of numerical addresses.\n""                       Can be a prefix, e.g. \"192.168.100.\" to match a\n""                       simple subnet, for more control build libvncserver\n""                       with libwrap support.  If the list contains a \"/\"\n""                       it instead is a interpreted as a file containing\n""                       addresses or prefixes that is re-read each time a new\n""                       client connects.  Lines can be commented out with the\n""                       \"#\" character in the usual way.\n""-localhost             Same as -allow 127.0.0.1\n""-viewpasswd string     Supply a 2nd password for view-only logins.  The -passwd\n""                       (full-access) password must also be supplied.\n""-passwdfile filename   Specify libvncserver -passwd via the first line of\n""                       the file \"filename\" instead of via command line.\n""                       If a second non blank line exists in the file it is\n""                       taken as a view-only password (i.e. -viewpasswd) Note:\n""                       this is a simple plaintext passwd, see also -rfbauth\n""                       and -storepasswd below.\n""-storepasswd pass file Store password \"pass\" as the VNC password in the\n""                       file \"file\".  Once the password is stored the\n""                       program exits.  Use the password via \"-rfbauth file\"\n""-accept string         Run a command (possibly to prompt the user at the\n""                       X11 display) to decide whether an incoming client\n""                       should be allowed to connect or not.  \"string\" is\n""                       an external command run via system(3) or some special\n""                       cases described below.  Be sure to quote \"string\"\n""                       if it contains spaces, etc.  If the external command\n""                       returns 0 the client is accepted, otherwise the client\n""                       is rejected.  See below for an extension to accept a\n""                       client view-only.\n""\n""                       Environment: The RFB_CLIENT_IP environment variable will\n""                       be set to the incoming client IP number and the port\n""                       in RFB_CLIENT_PORT (or -1 if unavailable).  Similarly,\n""                       RFB_SERVER_IP and RFB_SERVER_PORT (the x11vnc side\n""                       of the connection), are set to allow identification\n""                       of the tcp virtual circuit.  The x11vnc process\n""                       id will be in RFB_X11VNC_PID, a client id number in\n""                       RFB_CLIENT_ID, and the number of other connected clients\n""                       in RFB_CLIENT_COUNT.\n""\n""                       If \"string\" is \"popup\" then a builtin popup window\n""                       is used.  The popup will time out after 120 seconds,\n""                       use \"popup:N\" to modify the timeout to N seconds\n""                       (use 0 for no timeout)\n""\n""                       If \"string\" is \"xmessage\" then an xmessage(1)\n""                       invocation is used for the command.\n""\n""                       Both \"popup\" and \"xmessage\" will present an option\n""                       for accepting the client \"View-Only\" (the client\n""                       can only watch).  This option will not be presented if\n""                       -viewonly has been specified, in which case the entire\n""                       display is view only.\n""\n""                       If the user supplied command is prefixed with something\n""                       like \"yes:0,no:*,view:3 mycommand ...\" then this\n""                       associates the numerical command return code with\n""                       the actions: accept, reject, and accept-view-only,\n""                       respectively.  Use \"*\" instead of a number to indicate\n""                       the default action (in case the command returns an\n""                       unexpected value).  E.g. \"no:*\" is a good choice.\n""\n""                       Note that x11vnc blocks while the external command or\n""                       or popup is running (other clients may see no updates\n""                       during this period).\n""\n""                       More -accept tricks: use \"popupmouse\" to only allow\n""                       mouse clicks in the builtin popup to be recognized.\n""                       Similarly use \"popupkey\" to only recognize keystroke\n""                       responses.  All 3 of the popup keywords can be followed\n""                       by +N+M to supply a position for the popup window.\n""                       The default is to center the popup window.\n""-gone string           As -accept, except to run a user supplied command when\n""                       a client goes away (disconnects).  Unlike -accept,\n""                       the command return code is not interpreted by x11vnc.\n""\n""-noshm                 Do not use the MIT-SHM extension for the polling.\n""                       Remote displays can be polled this way: be careful this\n""                       can use large amounts of network bandwidth.  This is\n""                       also of use if the local machine has a limited number\n""                       of shm segments and -onetile is not sufficient.\n""-flipbyteorder         Sometimes needed if remotely polled host has different\n""                       endianness.  Ignored unless -noshm is set.\n""-onetile               Do not use the new copy_tiles() framebuffer mechanism,\n""                       just use 1 shm tile for polling.  Limits shm segments\n""                       used to 3.\n""\n""-blackout string       Black out rectangles on the screen. \"string\" is a\n""                       comma separated list of WxH+X+Y type geometries for\n""                       each rectangle.\n""-xinerama              If your screen is composed of multiple monitors\n""                       glued together via XINERAMA, and that screen is\n""                       non-rectangular this option will try to guess the\n""                       areas to black out (if your system has libXinerama).\n""                       In general on XINERAMA displays you may need to use the\n""                       -xwarppointer option if the mouse pointer misbehaves.\n""\n""-o logfile             Write stderr messages to file \"logfile\" instead of\n""                       to the terminal.  Same as -logfile \"file\".\n""-rc filename           Use \"filename\" instead of $HOME/.x11vncrc for rc file.\n""-norc                  Do not process any .x11vncrc file for options.\n""-h, -help              Print this help text.\n""-V, -version           Print program version (last modification date).\n""\n""-q                     Be quiet by printing less informational output to\n""                       stderr.  Same as -quiet.\n""-bg                    Go into the background after screen setup.  Messages to\n""                       stderr are lost unless -o logfile is used.  Something\n""                       like this could be useful in a script:\n""                         port=`ssh $host \"x11vnc -display :0 -bg\" | grep PORT`\n""                         port=`echo \"$port\" | sed -e 's/PORT=//'`\n""                         port=`expr $port - 5900`\n""                         vncviewer $host:$port\n""\n""-modtweak              Option -modtweak automatically tries to adjust the AltGr\n""-nomodtweak            and Shift modifiers for differing language keyboards\n""                       between client and host.  Otherwise, only a single key\n""                       press/release of a Keycode is simulated (i.e. ignoring\n""                       the state of the modifiers: this usually works for\n""                       identical keyboards).  Also useful in resolving cases\n""                       where a Keysym is bound to multiple keys (e.g. \"<\" + \">\"\n""                       and \",\" + \"<\" keys).  Default: %s\n"#if 0"-isolevel3             When in modtweak mode, always send ISO_Level3_Shift to\n""                       the X server instead of Mode_switch (AltGr).\n"#endif"-xkb                   When in modtweak mode, use the XKEYBOARD extension\n""                       (if it exists) to do the modifier tweaking.  This is\n""                       powerful and should be tried if there are still\n""                       keymapping problems when using the simpler -modtweak.\n""-skip_keycodes string  Skip keycodes not on your keyboard but your X server\n""                       thinks exist.  Currently only applies to -xkb mode.\n""                       \"string\" is a comma separated list of decimal\n""                       keycodes.  Use this option to help x11vnc in the reverse\n""                       problem it tries to solve: Keysym -> Keycode(s) when\n""                       ambiguities exist.  E.g. -skip_keycodes 94,114\n""-add_keysyms           If a Keysym is received from a VNC viewer and\n""                       that Keysym does not exist in the X server, then\n""                       add the Keysym to the X server's keyboard mapping.\n""                       Added Keysyms will be removed when exiting.\n"#if 0"-xkbcompat             Ignore the XKEYBOARD extension.  Use as a workaround for\n""                       some keyboard mapping problems.  E.g. if you are using\n""                       an international keyboard (AltGr or ISO_Level3_Shift),\n""                       and the OS or keyboard where the VNC viewer is run\n""                       is not identical to that of the X server, and you are\n""                       having problems typing some keys.  Implies -nobell.\n"#endif"-clear_mods            At startup and exit clear the modifier keys by sending\n""                       KeyRelease for each one. The Lock modifiers are skipped.\n""                       Used to clear the state if the display was accidentally\n""                       left with any pressed down.\n""-clear_keys            As -clear_mods, except try to release any pressed key.\n""                       Note that this option and -clear_mods can interfere\n""                       with a person typing at the physical keyboard.\n""-remap string          Read Keysym remappings from file named \"string\".\n""                       Format is one pair of Keysyms per line (can be name\n""                       or hex value) separated by a space.  If no file named\n""                       \"string\" exists, it is instead interpreted as this\n""                       form: key1-key2,key3-key4,...  See <X11/keysymdef.h>\n""                       header file for a list of Keysym names, or use\n""                       xev(1). To map a key to a button click, use the\n""                       fake Keysyms \"Button1\", ..., etc.\n""                       E.g. -remap Super_R-Button2\n""-norepeat              Option -norepeat disables X server key auto repeat\n""-repeat                when VNC clients are connected.  This works around a\n""                       repeating keystrokes bug (triggered by long processing\n""                       delays between key down and key up client events:\n""                       either from large screen changes or high latency).\n""                       Note: your VNC viewer side will likely do autorepeating,\n""                       so this is no loss unless someone is simultaneously at\n""                       the real X display.  Default: %s\n""\n""-nofb                  Ignore video framebuffer: only process keyboard and\n""                       pointer.  Intended for use with Win2VNC and x2vnc\n""                       dual-monitor setups.\n""-nobell                Do not watch for XBell events. (no beeps will be heard)\n""                       Note: XBell monitoring requires the XKEYBOARD extension.\n""-nosel                 Do not manage exchange of X selection/cutbuffer between\n""                       VNC viewers and the X server.\n""-noprimary             Do not poll the PRIMARY selection for changes to send\n""                       back to clients.  (PRIMARY is still set on received\n""                       changes, however).\n""\n""-cursor [mode]         Sets how the pointer cursor shape (little icon at the\n""-nocursor              mouse pointer) should be handled.  The \"mode\" string\n""                       is optional and is described below.  The default\n""                       is to show some sort of cursor shape(s).  How this\n""                       is done depends on the VNC viewer and the X server.\n""                       Use -nocursor to disable cursor shapes completely.\n""\n""                       Some VNC viewers support the TightVNC CursorPosUpdates\n""                       and CursorShapeUpdates extensions (cuts down on\n""                       network traffic by not having to send the cursor image\n""                       every time the pointer is moved), in which case these\n""                       extensions are used (see -nocursorshape and -nocursorpos\n""                       below).  For other viewers the cursor shape is written\n""                       directly to the framebuffer every time the pointer is\n""                       moved or changed and gets sent along with the other\n""                       framebuffer updates.  In this case, there will be\n""                       some lag between the vnc viewer pointer and the remote\n""                       cursor position.\n""\n""                       If the X display supports retrieving the cursor shape\n""                       information from the X server, then the default\n""                       is to use that mode.  On Solaris this requires\n""                       the SUN_OVL extension and the -overlay option to be\n""                       supplied. (see also the -overlay_nomouse option). (Soon)\n""                       on XFree86/Xorg the XFIXES extension is required.\n""                       Either can be disabled with -nocursor, and also some\n""                       values of the \"mode\" option below.\n""\n""                       The \"mode\" string can be used to fine-tune the\n""                       displaying of cursor shapes.  It can be used the\n""                       following ways:\n""\n""                       \"-cursor X\" - when the cursor appears to be on the\n""                       root window, draw the familiar X shape.  Some desktops\n""                       such as GNOME cover up the root window completely,\n""                       and so this will not work, try \"X1\", etc, to try to\n""                       shift the tree depth.  On high latency links or slow\n""                       machines there will be a time lag between expected and\n""                       the actual cursor shape.\n""\n""                       \"-cursor some\" - like \"X\" but use additional\n""                       heuristics to try to guess if the window should have\n""                       a windowmanager-like resizer cursor or a text input\n""                       I-beam cursor.  This is a complete hack, but may be\n""                       useful in some situations because it provides a little\n""                       more feedback about the cursor shape.\n""\n""                       \"-cursor most\" - try to show as many cursors as\n""                       possible.  Often this will only be the same as \"some\".\n""                       On Solaris if XFIXES is not available, -overlay mode\n""                       will be used.\n""\n""-nocursorshape         Do not use the TightVNC CursorShapeUpdates extension\n""                       even if clients support it.  See -cursor above.\n""-cursorpos             Option -cursorpos enables sending the X cursor position\n""-nocursorpos           back to all vnc clients that support the TightVNC\n""                       CursorPosUpdates extension.  Other clients will be able\n""                       to see the pointer motions. Default: %s\n""-xwarppointer          Move the pointer with XWarpPointer(3X) instead of XTEST\n""                       extension.  Use this as a workaround if the pointer\n""                       motion behaves incorrectly, e.g.  on touchscreens or\n""                       other non-standard setups.  Also sometimes needed on\n""                       XINERAMA displays.\n""\n""-buttonmap string      String to remap mouse buttons.  Format: IJK-LMN, this\n""                       maps buttons I -> L, etc., e.g.  -buttonmap 13-31\n""\n""                       Button presses can also be mapped to keystrokes: replace\n""                       a button digit on the right of the dash with :<sym>:\n""                       or :<sym1>+<sym2>: etc. for multiple keys. For example,\n""                       if the viewing machine has a mouse-wheel (buttons 4 5)\n""                       but the x11vnc side does not, these will do scrolls:\n""                              -buttonmap 12345-123:Prior::Next:\n""                              -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:\n""\n""                       See <X11/keysymdef.h> header file for a list of Keysyms,\n""                       or use the xev(1) program.  Note: mapping of button\n""                       clicks to Keysyms may not work if -modtweak or -xkb is\n""                       needed for the Keysym.\n""\n""                       If you include a modifier like \"Shift_L\" the\n""                       modifier's up/down state is toggled, e.g. to send\n""                       \"The\" use :Shift_L+t+Shift_L+h+e: (the 1st one is\n""                       shift down and the 2nd one is shift up). (note: the\n""                       initial state of the modifier is ignored and not reset)\n""                       To include button events use \"Button1\", ... etc.\n""\n""-nodragging            Do not update the display during mouse dragging events\n""                       (mouse motion with a button held down).  Greatly\n""                       improves response on slow setups, but you lose all\n""                       visual feedback for drags, text selection, and some\n""                       menu traversals.\n""-old_pointer           Use the original pointer input handling mechanism.\n""                       See check_input() and pointer() in source file for\n""                       details.\n""-old_pointer2          The default pointer input handling algorithm was changed\n""                       again, this option indicates to use the second one.\n""-input_skip n          For the old pointer handling when non-threaded: try to\n""                       read n user input events before scanning display. n < 0\n""                       means to act as though there is always user input.\n""\n""-debug_pointer         Print debugging output for every pointer event.\n""-debug_keyboard        Print debugging output for every keyboard event.\n""                       Same as -dp and -dk, respectively.  Use multiple\n""                       times for more output.\n""\n""-defer time            Time in ms to wait for updates before sending to client\n""                       (deferUpdateTime)  Default: %d\n""-wait time             Time in ms to pause between screen polls.  Used to cut\n""                       down on load.  Default: %d\n""-nap                   Monitor activity and if low take longer naps between\n""                       polls to really cut down load when idle.  Default: %s\n""\n""-sigpipe string        Broken pipe (SIGPIPE) handling.  \"string\" can be\n""                       \"ignore\" or \"exit\".  For \"ignore\" libvncserver\n""                       will handle the abrupt loss of a client and continue,\n""                       for \"exit\" x11vnc will cleanup and exit at the 1st\n""                       broken connection.  Default: \"ignore\".\n""-threads               Whether or not to use the threaded libvncserver\n""-nothreads             algorithm [rfbRunEventLoop] if libpthread is available\n""                       Default: %s\n""\n""-fs f                  If the fraction of changed tiles in a poll is greater\n""                       than f, the whole screen is updated.  Default: %.2f\n""-gaps n                Heuristic to fill in gaps in rows or cols of n or\n""                       less tiles.  Used to improve text paging.  Default: %d\n""-grow n                Heuristic to grow islands of changed tiles n or wider\n""                       by checking the tile near the boundary.  Default: %d\n""-fuzz n                Tolerance in pixels to mark a tiles edges as changed.\n""                       Default: %d\n""%s\n""\n""These options are passed to libvncserver:\n""\n";	/* have both our help and rfbUsage to stdout for more(1), etc. */	dup2(1, 2);	fprintf(stderr, help, lastmod,		view_only ? "on":"off",		shared ? "on":"off",		vnc_connect ? "-vncconnect":"-novncconnect",		use_modifier_tweak ? "-modtweak":"-nomodtweak",		no_autorepeat ? "-norepeat":"-repeat",		cursor_pos_updates ? "-cursorpos":"-nocursorpos",		defer_update,		waitms,		take_naps ? "on":"off",		use_threads ? "-threads":"-nothreads",		fs_frac,		gaps_fill,		grow_fill,		tile_fuzz,		""	);	rfbUsage();	exit(1);}