Commit 6e62d877 authored by Bill Allombert's avatar Bill Allombert

Add --set-tap-map option from libinput

parent 842f8adb
Version 0.0.6 -- UNRELEASED
* Add option --set-tap-map from libinput 1.5
Version 0.0.5 -- 29 Jun 2017
* Partial resync with libinput 1.6.0
......
......@@ -11,7 +11,7 @@ AM_CONFIG_HEADER(src/config.h)
AC_PROG_CC
PKG_PROG_PKG_CONFIG()
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.3.3])
PKG_CHECK_MODULES(LIBINPUT, [libinput >= 1.5])
PKG_CHECK_MODULES(LIBUDEV, [libudev])
PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
......
......@@ -49,6 +49,7 @@ enum options {
OPT_VERBOSE,
OPT_TAP_ENABLE,
OPT_TAP_DISABLE,
OPT_TAP_MAP,
OPT_DRAG_ENABLE,
OPT_DRAG_DISABLE,
OPT_DRAG_LOCK_ENABLE,
......@@ -107,6 +108,7 @@ tools_usage(void)
"--set-scroll-button=BTN_MIDDLE ... set the button to the given button code\n"
"--set-profile=[adaptive|flat].... set pointer acceleration profile\n"
"--set-speed=<value>.... set pointer acceleration speed (allowed range [-1, 1]) \n"
"--set-tap-map=[lrm|lmr] ... set button mapping for tapping\n"
"\n"
"These options apply to all applicable devices, if a feature\n"
"is not explicitly specified it is left at each device's default.\n"
......@@ -136,6 +138,7 @@ tools_init_context(struct tools_context *context)
memset(options, 0, sizeof(*options));
options->tapping = -1;
options->tap_map = -1;
options->drag = -1;
options->drag_lock = -1;
options->natural_scroll = -1;
......@@ -227,6 +230,20 @@ tools_parse_args(int argc, char **argv, struct tools_context *context)
case OPT_TAP_DISABLE:
options->tapping = 0;
break;
case OPT_TAP_MAP:
if (!optarg) {
tools_usage();
return 1;
}
if (streq(optarg, "lrm")) {
options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LRM;
} else if (streq(optarg, "lmr")) {
options->tap_map = LIBINPUT_CONFIG_TAP_MAP_LMR;
} else {
tools_usage();
return 1;
}
break;
case OPT_DRAG_ENABLE:
options->drag = 1;
break;
......@@ -478,6 +495,9 @@ tools_device_apply_config(struct libinput_device *device,
{
if (options->tapping != -1)
libinput_device_config_tap_set_enabled(device, options->tapping);
if (options->tap_map != (enum libinput_config_tap_button_map)-1)
libinput_device_config_tap_set_button_map(device,
options->tap_map);
if (options->drag != -1)
libinput_device_config_tap_set_drag_enabled(device,
options->drag);
......
......@@ -48,6 +48,7 @@ struct tools_options {
int middlebutton;
enum libinput_config_click_method click_method;
enum libinput_config_scroll_method scroll_method;
enum libinput_config_tap_button_map tap_map;
int scroll_button;
double speed;
int dwt;
......
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