mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
add sensitivity to ipc
This commit is contained in:
parent
5d60ebf743
commit
1873b348ad
2 changed files with 15 additions and 3 deletions
|
|
@ -1006,12 +1006,21 @@ json_object *ipc_json_describe_input(struct sway_input_device *device) {
|
|||
if (device->wlr_device->type == WLR_INPUT_DEVICE_POINTER) {
|
||||
struct input_config *ic = input_device_get_config(device);
|
||||
float scroll_factor = 1.0f;
|
||||
if (ic != NULL && !isnan(ic->scroll_factor) &&
|
||||
ic->scroll_factor != FLT_MIN) {
|
||||
scroll_factor = ic->scroll_factor;
|
||||
float sensitivity = 1.0f;
|
||||
if (ic != NULL) {
|
||||
if (!isnan(ic->scroll_factor) && ic->scroll_factor != FLT_MIN) {
|
||||
scroll_factor = ic->scroll_factor;
|
||||
}
|
||||
|
||||
if (!isnan(ic->sensitivity) && ic->sensitivity != FLT_MIN) {
|
||||
sensitivity = ic->sensitivity;
|
||||
}
|
||||
}
|
||||
|
||||
json_object_object_add(object, "scroll_factor",
|
||||
json_object_new_double(scroll_factor));
|
||||
json_object_object_add(object, "sensitivity",
|
||||
json_object_new_double(sensitivity));
|
||||
}
|
||||
|
||||
if (wlr_input_device_is_libinput(device->wlr_device)) {
|
||||
|
|
|
|||
|
|
@ -1134,6 +1134,9 @@ following properties:
|
|||
|- scroll_factor
|
||||
: floating
|
||||
: (Only pointers) Multiplier applied on scroll event values.
|
||||
|- sensitivity
|
||||
: floating
|
||||
: (Only pointers) Multiplier applied on relative pointer movements.
|
||||
|- libinput
|
||||
: object
|
||||
: (Only libinput devices) An object describing the current device settings.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue