diff options
Diffstat (limited to 'tools/libinput-list-devices.c')
-rw-r--r-- | tools/libinput-list-devices.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/libinput-list-devices.c b/tools/libinput-list-devices.c index c156bf0..21685d9 100644 --- a/tools/libinput-list-devices.c +++ b/tools/libinput-list-devices.c @@ -172,6 +172,35 @@ click_defaults(struct libinput_device *device) return str; } +static char* +accel_profiles(struct libinput_device *device) +{ + uint32_t profiles; + char *str; + enum libinput_config_accel_profile profile; + + if (!libinput_device_config_accel_is_available(device)) { + xasprintf(&str, "n/a"); + return str; + } + + profiles = libinput_device_config_accel_get_profiles(device); + if (profiles == LIBINPUT_CONFIG_ACCEL_PROFILE_NONE) { + xasprintf(&str, "none"); + return str; + } + + profile = libinput_device_config_accel_get_default_profile(device); + xasprintf(&str, + "%s%s%s%s", + (profile == LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT) ? "*" : "", + (profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT) ? "flat" : "", + (profile == LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) ? "*" : "", + (profiles & LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE) ? "adaptive" : ""); + + return str; +} + static const char * dwt_default(struct libinput_device *device) { @@ -249,6 +278,10 @@ print_device_notify(struct libinput_event *ev) printf("Disable-w-typing: %s\n", dwt_default(dev)); + str = accel_profiles(dev); + printf("Accel profiles: %s\n", str); + free(str); + printf("\n"); } |