commit a5c6816095158ff01ace12403bc527fec8c8af84
parent bcceb61b43c917247800d104d1fa064f51ab56a1
Author: Sergei Dolgov <dolgovs@gmail.com>
Date: Sat, 22 Jun 2019 14:32:39 +0200
calibration_matrix: add the current matrix to the IPC description for libinput devices
Diffstat:
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
@@ -798,6 +798,18 @@ static json_object *describe_libinput_device(struct libinput_device *device) {
json_object_object_add(object, "dwt", json_object_new_string(dwt));
}
+ if (libinput_device_config_calibration_has_matrix(device)) {
+ float matrix[6];
+ libinput_device_config_calibration_get_matrix(device, matrix);
+ struct json_object* array = json_object_new_array();
+ struct json_object* x;
+ for (int i = 0; i < 6; i++) {
+ x = json_object_new_double(matrix[i]);
+ json_object_array_add(array, x);
+ }
+ json_object_object_add(object, "calibration_matrix", array);
+ }
+
return object;
}
diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd
@@ -1107,6 +1107,10 @@ following properties will be included for devices that support them:
|- dwt
: string
: Whether disable-while-typing is enabled. It can be _enabled_ or _disabled_
+|- calibration_matrix
+: array
+: An array of 6 floats representing the calibration matrix for absolute
+ devices such as touchscreens
*Example Reply:*