mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-15 05:00:19 +01:00
tools: print the rotation angle in libinput-list-devices
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
7aa6b40f31
commit
e3e8d83457
1 changed files with 20 additions and 0 deletions
|
|
@ -225,6 +225,22 @@ dwt_default(struct libinput_device *device)
|
|||
return "disabled";
|
||||
}
|
||||
|
||||
static char *
|
||||
rotation_default(struct libinput_device *device)
|
||||
{
|
||||
char *str;
|
||||
double angle;
|
||||
|
||||
if (!libinput_device_config_rotation_is_available(device)) {
|
||||
xasprintf(&str, "n/a");
|
||||
return str;
|
||||
}
|
||||
|
||||
angle = libinput_device_config_rotation_get_angle(device);
|
||||
xasprintf(&str, "%.1f", angle);
|
||||
return str;
|
||||
}
|
||||
|
||||
static void
|
||||
print_device_notify(struct libinput_event *ev)
|
||||
{
|
||||
|
|
@ -298,6 +314,10 @@ print_device_notify(struct libinput_event *ev)
|
|||
printf("Accel profiles: %s\n", str);
|
||||
free(str);
|
||||
|
||||
str = rotation_default(dev);
|
||||
printf("Rotation: %s\n", str);
|
||||
free(str);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue