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

Specific input device configuration #371

Open
YaLTeR opened this issue May 21, 2024 · 6 comments
Open

Specific input device configuration #371

YaLTeR opened this issue May 21, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@YaLTeR
Copy link
Owner

YaLTeR commented May 21, 2024

Ability to configure specific input devices.

Syntax: something along

input {
    mouse "identifier" {
        // Settings for this device.
    }
}

Resolution for a given device:

  1. Search for settings block matching this device's identifier.
  2. If not found, use the general block for this device's type.

Identifier: check what other compositors use, guess it's something libinput should be exposing.

For keyboards, it should support per-keyboard XKB config.

@YaLTeR YaLTeR added the enhancement New feature or request label May 21, 2024
@FreeFull
Copy link
Contributor

This should include the ability to disable the device, too

@rustysec
Copy link
Contributor

I was looking through the current implementation and at the smithay code, and I don't see how to accomplish this at the moment. 100% possible I'm just missing something obvious, still trying to get to know the code base.

@YaLTeR
Copy link
Owner Author

YaLTeR commented May 23, 2024

Are you referring to something in particular? For libinput settings, it should be possible to simply get the device name and find the right config section in apply_libinput_settings().

For dynamic XKB, you need to look in on_keyboard(), extract the libinput device like this (pretty cursed, but possible), then switch the XKB settings similar to how config hot-reload works I guess?

@nebulosa2007
Copy link

This should include the ability to disable the device, too

I'm expand the request: it should be permanent/toggle (via config file) or eventually (via niri msg action ...).

Use cases are: hotkeys to on/off touchpad, temporary off touchpad while mouse is connected.

@YaLTeR
Copy link
Owner Author

YaLTeR commented May 23, 2024

This can work similarly to niri msg output: apply a config change transiently until the input section is modified in the real config.

@rustysec
Copy link
Contributor

@YaLTeR Aha, that was the "obvious" hint I was missing. My cursory look through the config and input code just missed this. Thanks!

yuja added a commit to yuja/niri that referenced this issue May 28, 2024
This is called "events <mode>" in Sway, but I choose "send-events-mode" for
consistency with libinput.

I think this option also applies to keyboards, but I'm not going to add the one
because we don't have libinput machinery for the keyboard config, and it's
unlikely that user wants to disable _all_ keyboards. OTOH, pointer devices can
be disabled per type. Perhaps, this should be revisited after implementing YaLTeR#371.
yuja added a commit to yuja/niri that referenced this issue May 28, 2024
This is called "events <mode>" in Sway, but I choose "send-events-mode" for
consistency with libinput.

I think this option also applies to keyboards, but I'm not going to add the one
because we don't have libinput machinery for the keyboard config, and it's
unlikely that user wants to disable _all_ keyboards. OTOH, pointer devices can
be disabled per type. Perhaps, this should be revisited after implementing YaLTeR#371.
yuja added a commit to yuja/niri that referenced this issue May 29, 2024
This is called "events <mode>" in Sway, but we decided to use more abstracted
form for consistency with the other config items. "disabled-on-external-mouse"
is added only to touchpads, but there might be other devices that support this
option.

I think "off" also applies to keyboards, but I'm not going to add the one
because we don't have libinput machinery for the keyboard config, and it's
unlikely that user wants to disable _all_ keyboards. OTOH, pointer devices can
be disabled per type. Perhaps, this should be revisited after implementing YaLTeR#371.
yuja added a commit to yuja/niri that referenced this issue May 29, 2024
This is called "events <mode>" in Sway, but we decided to use more abstracted
form for consistency with the other config items. "disabled-on-external-mouse"
is added only to touchpads, but there might be other devices that support this
option.

I think "off" also applies to keyboards, but I'm not going to add the one
because we don't have libinput machinery for the keyboard config, and it's
unlikely that user wants to disable _all_ keyboards. OTOH, pointer devices can
be disabled per type. Perhaps, this should be revisited after implementing YaLTeR#371.
YaLTeR pushed a commit that referenced this issue May 29, 2024
This is called "events <mode>" in Sway, but we decided to use more abstracted
form for consistency with the other config items. "disabled-on-external-mouse"
is added only to touchpads, but there might be other devices that support this
option.

I think "off" also applies to keyboards, but I'm not going to add the one
because we don't have libinput machinery for the keyboard config, and it's
unlikely that user wants to disable _all_ keyboards. OTOH, pointer devices can
be disabled per type. Perhaps, this should be revisited after implementing #371.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants