WIP: Add middle mouse button emulation setting #1146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is an initial attempt to add middle mouse button emulation for 1756, but it has some issues that I'm hoping for suggestions to correct, as I'm not sure if I'm making mistakes due to lack of experience with rust and cosmic, or there's some underlying issue going on that I'm not understanding.
The
middle_button_emulation
setting already exists on thecosmic-comp
side, and just needs the ability to set it viacosmic-settings
, this PR adds that support.Known issues
Currently, when enabling middle mouse emulation in
cosmic-settings
with this branch, the setting is set correctly in the configuration file (~/.config/cosmic/com.system76.CosmicComp/v1/input_default
), but the mouse is then unable to click with either the left or right mouse buttons. Unplugging the mouse's USB dongle and re-inserting it allows it to work again, with middle mouse button emulation working, but I'm not sure why mouse buttons become unresponsive when setting it initally.I've also tried to add this for touchpads, though my touch pad does not have buttons itself, and this setting can't be enabled at all, the toggle doesn't change in
cosmic-settings
. I'm not sure if it's because my touchpad is missing buttons, or if I've done something wrong in the code. I'd appreciate someone to give some insight or test with a touchpad with physical buttons.I haven't added English placeholder text to other i18n languages. Is there a simple way to copy it around, or to add translations?