diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/ipc-json.c | 12 | ||||
-rw-r--r-- | sway/sway-ipc.7.scd | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c index 7a65be07..87aef47b 100644 --- a/sway/ipc-json.c +++ b/sway/ipc-json.c | |||
@@ -798,6 +798,18 @@ static json_object *describe_libinput_device(struct libinput_device *device) { | |||
798 | json_object_object_add(object, "dwt", json_object_new_string(dwt)); | 798 | json_object_object_add(object, "dwt", json_object_new_string(dwt)); |
799 | } | 799 | } |
800 | 800 | ||
801 | if (libinput_device_config_calibration_has_matrix(device)) { | ||
802 | float matrix[6]; | ||
803 | libinput_device_config_calibration_get_matrix(device, matrix); | ||
804 | struct json_object* array = json_object_new_array(); | ||
805 | struct json_object* x; | ||
806 | for (int i = 0; i < 6; i++) { | ||
807 | x = json_object_new_double(matrix[i]); | ||
808 | json_object_array_add(array, x); | ||
809 | } | ||
810 | json_object_object_add(object, "calibration_matrix", array); | ||
811 | } | ||
812 | |||
801 | return object; | 813 | return object; |
802 | } | 814 | } |
803 | 815 | ||
diff --git a/sway/sway-ipc.7.scd b/sway/sway-ipc.7.scd index 8e5bf874..3657dcd6 100644 --- 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: | |||
1107 | |- dwt | 1107 | |- dwt |
1108 | : string | 1108 | : string |
1109 | : Whether disable-while-typing is enabled. It can be _enabled_ or _disabled_ | 1109 | : Whether disable-while-typing is enabled. It can be _enabled_ or _disabled_ |
1110 | |- calibration_matrix | ||
1111 | : array | ||
1112 | : An array of 6 floats representing the calibration matrix for absolute | ||
1113 | devices such as touchscreens | ||
1110 | 1114 | ||
1111 | 1115 | ||
1112 | *Example Reply:* | 1116 | *Example Reply:* |