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 device updates #2510

Merged
merged 6 commits into from
Feb 24, 2025
Merged

Input device updates #2510

merged 6 commits into from
Feb 24, 2025

Conversation

soreau
Copy link
Member

@soreau soreau commented Nov 6, 2024

  • Adds the ability to configure input devices that might have matching names
  • Refactor so hotplugging a device only refreshes the configuration for that device, not all devices
  • Add calibration option for touch devices
  • Add a way to configure multiple keyboards and mice with different settings

@soreau soreau force-pushed the input-device-updates branch 3 times, most recently from 91db71d to fcc81c1 Compare November 6, 2024 08:42
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+10 for the idea. I was thinking of whether we can make this work fully dynamically (currently if you want to add a section, you have to restart Wayfire) but I don't think this can be done easily.

@@ -49,7 +49,7 @@ class config_backend_t
* described in input-device.xml
*/
virtual std::shared_ptr<config::section_t> get_input_device_section(
wlr_input_device *device);
std::string const & prefix, wlr_input_device *device);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs API/ABI version bump :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, I forgot to bump! :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you must have forgotten to push a commit upstream, because this also hasn't been resolved ...

@soreau
Copy link
Member Author

soreau commented Nov 12, 2024

+10 for the idea. I was thinking of whether we can make this work fully dynamically (currently if you want to add a section, you have to restart Wayfire) but I don't think this can be done easily.

Thanks for the review! However, I don't think it is true that you need to restart wayfire, but only hot(re)plug the input device in question. Of course this might not be completely optimal, but a full restart is not needed as far as I understand.

@soreau soreau force-pushed the input-device-updates branch 2 times, most recently from f98446b to 748b554 Compare November 22, 2024 04:52
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'll test to see whether this doesn't break my setup and merge if it doesn't (shouldn't by the looks of it). Feel free to update the wiki :)

Btw. has someone on matrix/irc tested this with multiple devices etc? I am fairly certain we can close some issues with this PR.

@soreau
Copy link
Member Author

soreau commented Nov 24, 2024

Btw. has someone on matrix/irc tested this with multiple devices etc? I am fairly certain we can close some issues with this PR.

I am not sure but @zougloub might be interested in testing.

@ammen99
Copy link
Member

ammen99 commented Nov 24, 2024

I think this fixes at least #2481 right?

@soreau
Copy link
Member Author

soreau commented Nov 24, 2024

I think this fixes at least #2481 right?

Yes, it should.

@soreau soreau force-pushed the input-device-updates branch from 748b554 to 6e7125f Compare November 25, 2024 18:29
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more things I found on a second review ..

@soreau soreau force-pushed the input-device-updates branch from 6e7125f to d2a11a7 Compare December 25, 2024 06:52
@soreau
Copy link
Member Author

soreau commented Dec 25, 2024

@zougloub If you want to test this before it's merged, now would be a good time. It should be 'ready'. 👍

@soreau soreau requested a review from ammen99 February 14, 2025 17:57
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, some more open questions:

  • We have the input-device.xml section. As far as I see, this will not be used anymore, as we are allowing per-device [input:] section. I think that therefore the option for mapping should be moved from input-device to input and input-device.xml should be removed as we dont use it.

  • Previous point raises the question of backward compatibility, maybe we can check whether [input-device] sections still exist and if yes, then merge them into the main device section and print a warning to the user?

  • The input section should no longer be a plugin in the XML, but an object (there is no practical difference, but a convention that objects are instantiated with different suffixes).

@soreau soreau force-pushed the input-device-updates branch from d2a11a7 to 391cd8b Compare February 18, 2025 14:31
@soreau
Copy link
Member Author

soreau commented Feb 18, 2025

* The input section should no longer be a `plugin` in the XML, but an `object` (there is no practical difference, but a convention that objects are instantiated with different suffixes).

I will just say that wcm doesn't support 'objects' so switching to this from 'plugin' will remove 'input' from wcm altogether (and I'm guessing there's some that might not appreciate this).

This patch adds additional checks for input-device sections in the config
file. It checks for ID_PATH, ID_SERIAL, LIBINPUT_DEVICE_GROUP then falls
back to the device name and finally the global input-device section. In
addition, debug information can be printed using '-d input-devices'.
This makes it so users can match devices, especially identical devices
lacking many of the usual differentiating properties.
Before, hotplugging a new device would refresh all input to output mappings.
Hotplugging an output will still refresh all input device mappings.
This adds a calibration option so that touch input devices can be calibrated
via wayfire configuration.
…ions

This patch checks for additional configuration sections so keyboards and
mice can be matched by name or with udev properties. Running wayfire with
'-d input-devices' will log the sections that are being checked, for reference.
This allows multiple keyboards and mice to be configured differently,
whereas before, all keyboards used the common configuration in the [input]
section. To be clear, no additional configuration is required. If no matching
configuration section is found for the device, [input] options will be used.
@soreau soreau force-pushed the input-device-updates branch from 391cd8b to 4da60bd Compare February 19, 2025 21:15
@soreau soreau requested a review from ammen99 February 20, 2025 03:58
@ammen99 ammen99 force-pushed the input-device-updates branch from f87e7b8 to 6511e52 Compare February 24, 2025 16:34
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@ammen99 ammen99 merged commit fe62fa9 into master Feb 24, 2025
8 checks passed
@ammen99 ammen99 deleted the input-device-updates branch February 24, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants