Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input configuration by input type #3784

Closed
kennylevinsen opened this issue Feb 27, 2019 · 3 comments
Closed

Input configuration by input type #3784

kennylevinsen opened this issue Feb 27, 2019 · 3 comments
Labels
enhancement New feature or incremental improvement

Comments

@kennylevinsen
Copy link
Member

Problem

Certain parameters (e.g. "natural_scroll"), is intended and/or only used with certain types of devices (e.g. touchpads).

At the current time, input configuration can only be applied to a single device, or with wildcard to all devices. For such parameters, the user will then either have to individually add all inputs that needs the type-specific configuration, or live with a wildcard that also applies to other, unwanted device types (e.g. inverting scroll on regular scroll wheels).

Potential solution

The ability to apply input configuration on device type would allow for users to make sensible default configurations for various device types (e.g. natural scroll on all touchpads), without interference between different device types (e.g. scroll inversion applying to both touchpads and mouse). Such functionality would ease shared configuration setups, and would allow reconfiguration-free use of new devices.

Example configuration

input type:touchpad {
   natural_scroll enabled
}

Potential problems

sway-input currently recognizes touchpads as "mouse", which is not granular enough. However, considering that GNOME can distinguish between such devices using libinput (i.e. it separates touchpad and mouse configuration), I suppose that the information should be available from libinput.

@RedSoxFan
Copy link
Member

sway-input currently recognizes touchpads as "mouse", which is not granular enough. However, considering that GNOME can distinguish between such devices using libinput (i.e. it separates touchpad and mouse configuration), I suppose that the information should be available from libinput.

Looks like GNOME checks whether the output of libinput_device_config_tap_get_finger_count is greater than zero for the device (https://gitlab.gnome.org/GNOME/mutter/blob/master/clutter/clutter/evdev/clutter-input-device-evdev.c#L1459)

@RedSoxFan RedSoxFan added the enhancement New feature or incremental improvement label Feb 27, 2019
@lolzballs
Copy link
Contributor

I'm looking into migrating to sway and I was looking for a way to do this type of configuration. This seems like something I can tackle in the next couple of days if no one else has started working on it.

lolzballs added a commit to lolzballs/wlroots that referenced this issue Mar 12, 2019
Keep track of whether an input is a touchpad or not.
The "touchpadiness" of an input is found using
libinput_device_config_tap_get_finger_count.
This is needed for swaywm/sway#3784
lolzballs added a commit to lolzballs/sway that referenced this issue Mar 12, 2019
Configurations take precendence in the following order:
wildcard < type_wildcard < identifier

Depends on lolzballs/wlroots@1bf17b5
lolzballs added a commit to lolzballs/wlroots that referenced this issue Mar 14, 2019
Keep track of whether an input is a touchpad or not.
The "touchpadiness" of an input is found using
libinput_device_config_tap_get_finger_count.
This is needed for swaywm/sway#3784

Fix formatting in libinput/pointer.c

Continution lines should be one tab
lolzballs added a commit to lolzballs/sway that referenced this issue Mar 15, 2019
Configurations take precendence in the following order:
wildcard < type_wildcard < identifier
lolzballs added a commit to lolzballs/sway that referenced this issue Mar 23, 2019
Configurations take precendence in the following order:
wildcard < type_wildcard < identifier
lolzballs added a commit to lolzballs/sway that referenced this issue Mar 26, 2019
The type configs are applied on top of the existing device config as the
devices appear. New type configs are applied on top of existing configs
as well.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 13, 2019
When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 13, 2019
When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 13, 2019
When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 14, 2019
When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 14, 2019
Add support for configurations that apply to a type of inputs
(i.e. natural scrolling on all touchpads). A type config is
differentiated by a `type:` prefix followed by the type it
corresponds to.

When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 14, 2019
Add support for configurations that apply to a type of inputs
(i.e. natural scrolling on all touchpads). A type config is
differentiated by a `type:` prefix followed by the type it
corresponds to.

When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
lolzballs added a commit to lolzballs/sway that referenced this issue Apr 14, 2019
Add support for configurations that apply to a type of inputs
(i.e. natural scrolling on all touchpads). A type config is
differentiated by a `type:` prefix followed by the type it
corresponds to.

When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
RedSoxFan pushed a commit that referenced this issue Apr 14, 2019
Add support for configurations that apply to a type of inputs
(i.e. natural scrolling on all touchpads). A type config is
differentiated by a `type:` prefix followed by the type it
corresponds to.

When new devices appear, the device config is merged on top of its
type config (if it exists). New type configs are applied on top of
existing configs.
@RedSoxFan
Copy link
Member

Closing via #3895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or incremental improvement
Development

No branches or pull requests

3 participants