diff options
author | Ran Benita <ran@unusedvar.com> | 2020-07-25 11:17:11 +0300 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-07-25 15:06:12 +0300 |
commit | f439ce188904f7a83c8e73d4ebc7a583a141c60f (patch) | |
tree | a418cd04d0c0815604f2fde67b94610ab3ca4424 /tools | |
parent | ce5eb1ac6d542bea11222670ec8438cdd074a833 (diff) | |
download | xorg-lib-libxkbcommon-f439ce188904f7a83c8e73d4ebc7a583a141c60f.tar.gz |
tools: some minor changes to xkbcli
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/interactive-evdev.c | 22 | ||||
-rw-r--r-- | tools/xkbcli-compile-keymap.1 | 42 | ||||
-rw-r--r-- | tools/xkbcli-how-to-type.1 | 19 | ||||
-rw-r--r-- | tools/xkbcli-interactive-evdev.1 | 44 | ||||
-rw-r--r-- | tools/xkbcli-interactive-wayland.1 | 19 | ||||
-rw-r--r-- | tools/xkbcli-interactive-x11.1 | 19 | ||||
-rw-r--r-- | tools/xkbcli-list.1 | 23 | ||||
-rw-r--r-- | tools/xkbcli.1 | 31 | ||||
-rw-r--r-- | tools/xkbcli.c | 8 |
9 files changed, 142 insertions, 85 deletions
diff --git a/tools/interactive-evdev.c b/tools/interactive-evdev.c index 0868b4f..36e7a14 100644 --- a/tools/interactive-evdev.c +++ b/tools/interactive-evdev.c @@ -372,15 +372,17 @@ sigintr_handler(int signum) static void usage(FILE *fp, char *progname) { - fprintf(fp, "Usage: %s [--rules <rules>] [--model <model>] " - "[--layout <layout>] [--variant <variant>] [--options <options>]\n", + fprintf(fp, "Usage: %s [--rules=<rules>] [--model=<model>] " + "[--layout=<layout>] [--variant=<variant>] [--options=<options>]\n", progname); fprintf(fp, " or: %s --keymap <path to keymap file>\n", progname); fprintf(fp, "For both:\n" " --report-state-changes (report changes to the state)\n" - " --enable-compose (enable compose)\n" - " --consumed-mode={gtk|xkb} (select the consumed mode)\n"); + " --enable-compose (enable Compose)\n" + " --consumed-mode={xkb|gtk} (select the consumed modifiers mode, default: xkb)\n" + " --evdev-offset=NUM (default: 8)\n" + ); } int @@ -406,6 +408,7 @@ main(int argc, char *argv[]) OPT_VARIANT, OPT_OPTION, OPT_KEYMAP, + OPT_EVDEV_OFFSET, OPT_CONSUMED_MODE, OPT_COMPOSE, OPT_REPORT_STATE, @@ -418,6 +421,7 @@ main(int argc, char *argv[]) {"variant", required_argument, 0, OPT_VARIANT}, {"options", required_argument, 0, OPT_OPTION}, {"keymap", required_argument, 0, OPT_KEYMAP}, + {"evdev-offset", required_argument, 0, OPT_EVDEV_OFFSET}, {"consumed-mode", required_argument, 0, OPT_CONSUMED_MODE}, {"enable-compose", no_argument, 0, OPT_COMPOSE}, {"report-state-changes", no_argument, 0, OPT_REPORT_STATE}, @@ -453,6 +457,15 @@ main(int argc, char *argv[]) case OPT_KEYMAP: keymap_path = optarg; break; + case OPT_EVDEV_OFFSET: + errno = 0; + evdev_offset = strtol(optarg, NULL, 10); + if (errno) { + fprintf(stderr, "error: --evdev-offset option expects a number\n"); + usage(stderr, argv[0]); + return EXIT_INVALID_USAGE; + } + break; case OPT_REPORT_STATE: report_state_changes = true; break; @@ -465,6 +478,7 @@ main(int argc, char *argv[]) } else if (strcmp(optarg, "xkb") == 0) { consumed_mode = XKB_CONSUMED_MODE_XKB; } else { + fprintf(stderr, "error: invalid --consumed-mode \"%s\"\n", optarg); usage(stderr, argv[0]); return EXIT_INVALID_USAGE; } diff --git a/tools/xkbcli-compile-keymap.1 b/tools/xkbcli-compile-keymap.1 index 64c4263..98498f7 100644 --- a/tools/xkbcli-compile-keymap.1 +++ b/tools/xkbcli-compile-keymap.1 @@ -7,7 +7,7 @@ \fBxkbcli\fR compile\-keymap [\-\-help] [OPTIONS] . .SH "DESCRIPTION" -\fBxkbcli compile\-keymap\fR compiles and prints a keymap based on the given options\. +\fBxkbcli compile\-keymap\fR compiles and prints a keymap based on the given options. . .SH "OPTIONS" . @@ -16,51 +16,55 @@ Print help and exit . .TP -\fB\-\-verbose\fR +.B \-\-verbose Enable verbose debugging output . .TP -\fB\-\-rmlvo\fR +.B \-\-rmlvo Print the full RMLVO with the defaults filled in for missing elements . .TP -\fB\-\-from\-xkb\fR -Load the XKB file from stdin, ignore RMLVO options\. This option must not be used with \fB\-\-kccgst\fR\. +.B \-\-from\-xkb +Load the XKB file from stdin, ignore RMLVO options. +This option must not be used with \fB\-\-kccgst\fR. . .TP -\fB\-\-include\fR -Add the given path to the include path list\. This option is order\-dependent, include paths given first are searched first\. If an include path is given, the default include path list is not used\. Use \fB\-\-include\-defaults\fR to add the default include paths +.B \-\-include=PATH +Add the given path to the include path list. +This option is order\-dependent, include paths given first are searched first. +If an include path is given, the default include path list is not used. +Use \fB\-\-include\-defaults\fR to add the default include paths. . .TP -\fB\-\-include\-defaults\fR -Add the default set of include directories\. This option is order\-dependent, include paths given first are searched first\. +.B \-\-include\-defaults +Add the default set of include directories. +This option is order-dependent, include paths given first are searched first. . .TP -\fB\-\-rules <rules>\fR +.B \-\-rules=<rules> The XKB ruleset . .TP -\fB\-\-model <model>\fR +.B \-\-model=<model> The XKB model . .TP -\fB\-\-layout <layout>\fR: -. -.IP +.B \-\-layout=<layout> The XKB layout . .TP -\fB\-\-variant <variant>\fR: -. -.IP +.B \-\-variant=<variant> The XKB layout variant . .TP -\fB\-\-options <options>\fR +.B \-\-options=<options> The XKB options . .SH "SEE ALSO" \fBxkbcli\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli-how-to-type.1 b/tools/xkbcli-how-to-type.1 index 60d42ff..aca5280 100644 --- a/tools/xkbcli-how-to-type.1 +++ b/tools/xkbcli-how-to-type.1 @@ -7,35 +7,38 @@ \fBxkbcli\fR how\-to\-type [OPTIONS] <codepoint> . .SH "DESCRIPTION" -\fBxkbcli how\-to\-type\fR prints key sequences to type the given Unicode codepoint\. +\fBxkbcli how\-to\-type\fR prints key sequences to type the given Unicode codepoint. . .P -Pipe into \fBcolumn \-ts $\'\e\et\'\fR for nicely aligned output\. +Pipe into \fBcolumn \-ts $\'\e\et\'\fR for nicely aligned output. . .SH "OPTIONS" . .TP -\fB\-\-rules <rules>\fR +.B \-\-rules=<rules> The XKB ruleset . .TP -\fB\-\-model <model>\fR +.B \-\-model=<model> The XKB model . .TP -\fB\-\-layout <layout>\fR +.B \-\-layout=<layout> The XKB layout . .TP -\fB\-\-variant <variant>\fR +.B \-\-variant=<variant> The XKB layout variant . .TP -\fB\-\-options <options>\fR +.B \-\-options=<options> The XKB options . .SH "SEE ALSO" \fBxkbcli\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli-interactive-evdev.1 b/tools/xkbcli-interactive-evdev.1 index 8b76dc7..1c0022c 100644 --- a/tools/xkbcli-interactive-evdev.1 +++ b/tools/xkbcli-interactive-evdev.1 @@ -1,61 +1,73 @@ .TH "XKBCLI\-INTERACTIVE\-EVDEV" "1" "" "" "libxkbcommon manual" . .SH "NAME" -\fBxkbcli\-interactive\-evdev\fR \- interactive debugger for XKB maps +\fBxkbcli\-interactive\-evdev\fR \- interactive debugger for XKB keymaps . .SH "SYNOPSIS" \fBxkbcli\fR interactive\-evdev [\-\-help] [OPTIONS] . .SH "DESCRIPTION" -\fBxkbcli interactive\-evdev\fR is a commandline tool to interactively debug XKB maps by listening to \fB/dev/input/eventX\fR evdev devices\. +\fBxkbcli interactive\-evdev\fR is a commandline tool to interactively debug XKB keymaps by listening to \fB/dev/input/eventX\fR evdev devices (Linux). . .P -This is a debugging tool, its behavior or output is not guaranteed to be stable\. +.B xkbcli interactive\-evdev +requires permission to open the evdev device nodes. +This usually requires being the \fBroot\fR user or belonging to the \fBinput\fR group. +. +.P +Press the Escape key to exit. +. +.P +This is a debugging tool, its behavior or output is not guaranteed to be stable. . .SH "OPTIONS" . .TP -\fB\-\-help\fR +.B \-\-help Print help and exit . .TP -\fB\-\-rules <rules>\fR +.B \-\-rules=<rules> The XKB ruleset . .TP -\fB\-\-model <model>\fR +.B \-\-model=<model> The XKB model . .TP -\fB\-\-layout <layout>\fR +.B \-\-layout=<layout> The XKB layout . .TP -\fB\-\-variant <variant>\fR +.B \-\-variant=<variant> The XKB layout variant . .TP -\fB\-\-options <options>\fR +.B \-\-options=<options> The XKB options . .TP -\fB\-\-keymap\fR -Specify a keymap path\. This option is mutually exclusive with the rmlvo options\. +.B \-\-keymap=PATH +Specify a keymap path. +This option is mutually exclusive with the RMLVO options. . .TP -\fB\-\-report\-state\-changes\fR +.B \-\-report\-state\-changes Report changes to the keyboard state . .TP -\fB\-\-enable\-compose\fR -Enable compose functionality +.B \-\-enable\-compose +Enable Compose functionality . .TP -\fB\-\-consumed\-mode={gtk|xkb}\fR +.B \-\-consumed\-mode={xkb|gtk} Set the consumed modifiers mode (default: xkb) . .SH "SEE ALSO" \fBxkbcli\fR(1), \fBxkbcli\-interactive\-wayland\fR(1), \fBxkbcli\-interactive\-x11\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli-interactive-wayland.1 b/tools/xkbcli-interactive-wayland.1 index 3d1aec3..4c534ad 100644 --- a/tools/xkbcli-interactive-wayland.1 +++ b/tools/xkbcli-interactive-wayland.1 @@ -1,25 +1,34 @@ .TH "XKBCLI\-INTERACTIVE\-WAYLAND" "1" "" "" "libxkbcommon manual" . .SH "NAME" -\fBxkbcli\-interactive\-wayland\fR \- interactive debugger for XKB maps +\fBxkbcli\-interactive\-wayland\fR \- interactive debugger for XKB keymaps . .SH "SYNOPSIS" \fBxkbcli\fR interactive\-wayland [\-\-help] [OPTIONS] . .SH "DESCRIPTION" -\fBxkbcli interactive\-wayland\fR is a commandline tool to interactively debug XKB maps by listening to wayland events\. This requires a Wayland compositor to be running\. +\fBxkbcli interactive\-wayland\fR is a commandline tool to interactively debug XKB keymaps by listening to wayland events. . .P -This is a debugging tool, its behavior or output is not guaranteed to be stable\. +This requires a Wayland compositor to be running. +. +.P +Press the Escape key to exit. +. +.P +This is a debugging tool, its behavior or output is not guaranteed to be stable. . .SH "OPTIONS" . .TP -\fB\-\-help\fR +.B \-\-help Print help and exit . .SH "SEE ALSO" \fBxkbcli\fR(1), \fBxkbcli\-interactive\-evdev\fR(1), \fBxkbcli\-interactive\-x11\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli-interactive-x11.1 b/tools/xkbcli-interactive-x11.1 index 36e58e1..72007c0 100644 --- a/tools/xkbcli-interactive-x11.1 +++ b/tools/xkbcli-interactive-x11.1 @@ -1,25 +1,34 @@ .TH "XKBCLI\-INTERACTIVE\-X11" "1" "" "" "libxkbcommon manual" . .SH "NAME" -\fBxkbcli\-interactive\-x11\fR \- interactive debugger for XKB maps +\fBxkbcli\-interactive\-x11\fR \- interactive debugger for XKB keymaps . .SH "SYNOPSIS" \fBxkbcli\fR interactive\-x11 [\-\-help] [OPTIONS] . .SH "DESCRIPTION" -\fBxkbcli interactive\-x11\fR is a commandline tool to interactively debug XKB maps by listening to X11 events\. This requires an X server to be running\. +\fBxkbcli interactive\-x11\fR is a commandline tool to interactively debug XKB keymaps by listening to X11 events. . .P -This is a debugging tool, its behavior or output is not guaranteed to be stable\. +This requires an X server to be running. +. +.P +Press the Escape key to exit. +. +.P +This is a debugging tool, its behavior or output is not guaranteed to be stable. . .SH "OPTIONS" . .TP -\fB\-\-help\fR +.B \-\-help Print help and exit . .SH "SEE ALSO" \fBxkbcli\fR(1), \fBxkbcli\-interactive\-evdev\fR(1), \fBxkbcli\-interactive\-wayland\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli-list.1 b/tools/xkbcli-list.1 index 3211efb..6f20cc1 100644 --- a/tools/xkbcli-list.1 +++ b/tools/xkbcli-list.1 @@ -1,41 +1,44 @@ .TH "XKBCLI\-LIST" "1" "" "" "libxkbcommon manual" . .SH "NAME" -\fBxkbcli\-list\fR \- list available XKB rules, models, layouts, variants and options +\fBxkbcli\-list\fR \- list available XKB models, layouts, variants and options . .SH "SYNOPSIS" -\fBxkbcli\fR list [\-\-help] [/path/to/xkbbase [/path/to/xkbbase] \.\.\.] +\fBxkbcli\fR list [\-\-help] [/path/to/xkbbase [/path/to/xkbbase] ...] . .SH "DESCRIPTION" -\fBxkbcli list\fR is a commandline tool to list available model, layout, variant and option (MLVO) values from the XKB registry\. +\fBxkbcli list\fR is a commandline tool to list available model, layout, variant and option (MLVO) values from the XKB registry. . .P -Arguments provided on the commandline are treated as XKB base directory installations\. +Arguments provided on the commandline are treated as XKB base directory installations. . .SH "OPTIONS" . .TP -\fB\-\-help\fR +.B \-\-help Print help and exit . .TP -\fB\-v, \-\-verbose\fR +.B \-v, \-\-verbose Increase verbosity, use multiple times for debugging output . .TP -\fB\-\-ruleset <name>\fR +.B \-\-ruleset=<name> Load the ruleset with the given name . .TP -\fB\-\-skip\-default\-paths\fR +.B \-\-skip\-default\-paths Do not load the default XKB include paths . .TP -\fB\-\-load\-exotic\fR +.B \-\-load\-exotic Load exotic (extra) layouts . .SH "SEE ALSO" \fBxkbcli\fR(1) . .P -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli.1 b/tools/xkbcli.1 index 6cfe4a4..6250291 100644 --- a/tools/xkbcli.1 +++ b/tools/xkbcli.1 @@ -7,42 +7,42 @@ \fBxkbcli\fR [\-\-help|\-\-version] <command> [\fIargs\fR] . .SH "DESCRIPTION" -\fBxkbcli\fR is a commandline tool to query, compile and test XKB keymaps, layouts and other elements\. +\fBxkbcli\fR is a commandline tool to query, compile and test XKB keymaps, layouts and other elements. . .SH "OPTIONS" . .TP -\fB\-\-help\fR +.B \-\-help Print help and exit . .TP -\fB\-\-version\fR +.B \-\-version Print the version and exit . .SH "COMMANDS" . .TP -\fBhow\-to\-type\fR -Show how to type a given unicode codepoint, see \fBxkbcli\-how\-to\-type\fR(1) +.B how\-to\-type +Show how to type a given Unicode codepoint, see \fBxkbcli\-how\-to\-type\fR(1) . .TP -\fBinteractive\-x11\fR -Interactive debugger for XKB maps for X11, see \fBxbkcli\-interactive\-x11\fR(1) +.B interactive\-x11 +Interactive debugger for XKB keymaps for X11, see \fBxbkcli\-interactive\-x11\fR(1) . .TP -\fBinteractive\-wayland\fR -Interactive debugger for XKB maps for Wayland, see \fBxkbcli\-interactive\-wayland\fR(1) +.B interactive\-wayland +Interactive debugger for XKB keymaps for Wayland, see \fBxkbcli\-interactive\-wayland\fR(1) . .TP -\fBinteractive\-evdev\fR -Interactive debugger for XKB maps for evdev, see \fBxkbcli\-interactive\-evdev\fR +.B interactive\-evdev +Interactive debugger for XKB keymaps for evdev (Linux), see \fBxkbcli\-interactive\-evdev\fR . .TP -\fBlist\fR +.B list List available layouts and more, see \fBxkbcli\-list\fR(1) . .P -Note that not all tools may be available on your system\. +Note that not all tools may be available on your system. . .SH "EXIT STATUS" . @@ -59,4 +59,7 @@ an error occured program was called with invalid arguments . .SH "SEE ALSO" -The libxkbcommon online documentation at \fIhttps://xkbcommon\.org\fR +The +.UR https://xkbcommon.org +libxkbcommon online documentation +.UE diff --git a/tools/xkbcli.c b/tools/xkbcli.c index 78a9aa5..ecab655 100644 --- a/tools/xkbcli.c +++ b/tools/xkbcli.c @@ -45,22 +45,22 @@ usage(void) #endif #if HAVE_XKBCLI_INTERACTIVE_WAYLAND " interactive-wayland\n" - " Interactive debugger for XKB maps for wayland\n" + " Interactive debugger for XKB keymaps for Wayland\n" "\n" #endif #if HAVE_XKBCLI_INTERACTIVE_x11 " interactive-x11\n" - " Interactive debugger for XKB maps for X11\n" + " Interactive debugger for XKB keymaps for X11\n" "\n" #endif #if HAVE_XKBCLI_INTERACTIVE_EVDEV " interactive-evdev\n" - " Interactive debugger for XKB maps for evdev\n" + " Interactive debugger for XKB keymaps for evdev (Linux)\n" "\n" #endif #if HAVE_XKBCLI_COMPILE_KEYMAP " compile-keymap\n" - " Compile n XKB keymap\n" + " Compile an XKB keymap\n" "\n" #endif #if HAVE_XKBCLI_HOW_TO_TYPE |