diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-01-27 13:54:00 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-01-27 13:54:00 +1000 |
commit | ae41aa146de6f377a7f9b433d92da3cb0bab85d2 (patch) | |
tree | 4de3a660c6624d999e335a0cb17cd8d883690e9b /tools | |
parent | de3f1fa6fa23cebef17640dc1eb4ea8df270ecd9 (diff) | |
parent | cba2278c3ab3479f8805f04dc7e80a8356e1d54d (diff) |
Merge branch 'master' into tablet-support
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libinput-list-devices.c | 13 | ||||
-rw-r--r-- | tools/shared.c | 16 | ||||
-rw-r--r-- | tools/shared.h | 1 |
3 files changed, 30 insertions, 0 deletions
diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c index 62eb915b..30bb2c43 100644 --- a/tools/libinput-list-devices.c +++ b/tools/libinput-list-devices.c @@ -48,6 +48,18 @@ tap_default(struct libinput_device *device) } static const char * +drag_default(struct libinput_device *device) +{ + if (!libinput_device_config_tap_get_finger_count(device)) + return "n/a"; + + if (libinput_device_config_tap_get_default_drag_enabled(device)) + return "enabled"; + else + return "disabled"; +} + +static const char * draglock_default(struct libinput_device *device) { if (!libinput_device_config_tap_get_finger_count(device)) @@ -263,6 +275,7 @@ print_device_notify(struct libinput_event *ev) printf("\n"); printf("Tap-to-click: %s\n", tap_default(dev)); + printf("Tap-and-drag: %s\n", drag_default(dev)); printf("Tap drag lock: %s\n", draglock_default(dev)); printf("Left-handed: %s\n", left_handed_default(dev)); printf("Nat.scrolling: %s\n", nat_scroll_default(dev)); diff --git a/tools/shared.c b/tools/shared.c index 5fe5862c..29af9ef5 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -45,6 +45,8 @@ enum options { OPT_VERBOSE, OPT_TAP_ENABLE, OPT_TAP_DISABLE, + OPT_DRAG_ENABLE, + OPT_DRAG_DISABLE, OPT_DRAG_LOCK_ENABLE, OPT_DRAG_LOCK_DISABLE, OPT_NATURAL_SCROLL_ENABLE, @@ -82,6 +84,8 @@ tools_usage() "Features:\n" "--enable-tap\n" "--disable-tap.... enable/disable tapping\n" + "--enable-drag\n" + "--disable-drag.... enable/disable tap-n-drag\n" "--enable-drag-lock\n" "--disable-drag-lock.... enable/disable tapping drag lock\n" "--enable-natural-scrolling\n" @@ -117,6 +121,7 @@ tools_init_context(struct tools_context *context) memset(options, 0, sizeof(*options)); options->tapping = -1; + options->drag = -1; options->drag_lock = -1; options->natural_scroll = -1; options->left_handed = -1; @@ -147,6 +152,8 @@ tools_parse_args(int argc, char **argv, struct tools_context *context) { "verbose", 0, 0, OPT_VERBOSE }, { "enable-tap", 0, 0, OPT_TAP_ENABLE }, { "disable-tap", 0, 0, OPT_TAP_DISABLE }, + { "enable-drag", 0, 0, OPT_DRAG_ENABLE }, + { "disable-drag", 0, 0, OPT_DRAG_DISABLE }, { "enable-drag-lock", 0, 0, OPT_DRAG_LOCK_ENABLE }, { "disable-drag-lock", 0, 0, OPT_DRAG_LOCK_DISABLE }, { "enable-natural-scrolling", 0, 0, OPT_NATURAL_SCROLL_ENABLE }, @@ -199,6 +206,12 @@ tools_parse_args(int argc, char **argv, struct tools_context *context) case OPT_TAP_DISABLE: options->tapping = 0; break; + case OPT_DRAG_ENABLE: + options->drag = 1; + break; + case OPT_DRAG_DISABLE: + options->drag = 0; + break; case OPT_DRAG_LOCK_ENABLE: options->drag_lock = 1; break; @@ -438,6 +451,9 @@ tools_device_apply_config(struct libinput_device *device, { if (options->tapping != -1) libinput_device_config_tap_set_enabled(device, options->tapping); + if (options->drag != -1) + libinput_device_config_tap_set_drag_enabled(device, + options->drag); if (options->drag_lock != -1) libinput_device_config_tap_set_drag_lock_enabled(device, options->drag_lock); diff --git a/tools/shared.h b/tools/shared.h index 0065fcc0..14ed9ccb 100644 --- a/tools/shared.h +++ b/tools/shared.h @@ -39,6 +39,7 @@ struct tools_options { int verbose; int tapping; + int drag; int drag_lock; int natural_scroll; int left_handed; |