-
Notifications
You must be signed in to change notification settings - Fork 184
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
Input device updates #2510
Conversation
soreau
commented
Nov 6, 2024
•
edited
Loading
edited
- 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
91db71d
to
fcc81c1
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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! :)
There was a problem hiding this comment.
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 ...
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. |
f98446b
to
748b554
Compare
There was a problem hiding this 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.
I am not sure but @zougloub might be interested in testing. |
I think this fixes at least #2481 right? |
Yes, it should. |
748b554
to
6e7125f
Compare
There was a problem hiding this 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 ..
6e7125f
to
d2a11a7
Compare
@zougloub If you want to test this before it's merged, now would be a good time. It should be 'ready'. 👍 |
There was a problem hiding this 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 frominput-device
toinput
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 anobject
(there is no practical difference, but a convention that objects are instantiated with different suffixes).
d2a11a7
to
391cd8b
Compare
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.
391cd8b
to
4da60bd
Compare
f87e7b8
to
6511e52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!