Skip to content

Conversation

@stefonarch
Copy link
Contributor

@stefonarch stefonarch commented Dec 6, 2025

Started to add checkboxes, combos and spinboxes and noticed that float values couldn't be read and written. The code for that was quite inspired by LLMs so it needs a really good check, besides the merge conflicts.
It compiles and works fine here.

immagine

I disabled "Touchpad disabled" as it really disables everything keyboard included, needed to hard reset the laptop, comments in the code, it needs an updated save/read method to separate settings for devices I guess.

@johanmalm
Copy link
Member

Thanks.

  • The setFloat() looks good.
  • I'm happy with adding float to std::variant<>. Might considering converting all that to a QVariant to simplify it, but can do that separately.
  • Are you happy to sort out the merge conflict yourself, or do you want me to take a look? (Not that I'm very good at sorting merge conflicts 😄)
  • I'm happy to merge this, but just for context let me describe what I had in mind. I've got a short(ish) to TODO list of further refactoring. Was then going to start looking at supporting 'objects' (e.g. keybinds, mousebinds and libinput configuration for different type of devices).

@johanmalm
Copy link
Member

If you're happy to do the merge conflict, looks like all you have to do it to remove the void setBoolfromString(QString name, QString value);

@johanmalm
Copy link
Member

johanmalm commented Dec 6, 2025

Hmm... actually there is a subtle consideration with the libinput settings because there are normally many input-devices which all have their own unique default settings.

We need to consider the following:

  1. Adopt an approach whereby libinput values are not set unless a user explicitly specifies them (maybe via a QCheckBox or something like that).
  2. We minimize coverage. In other words, we try to set the value for as few devices as possible. Presumably this means that we try to just set it for one devices by default, and failing that we try applying it to a category (like touchpad, touchscreen, tablet, etc), and only as a last resort do we apply to all devices. --EDIT-- Looking at the settings, I might be overthinking this second point.

@stefonarch
Copy link
Contributor Author

stefonarch commented Dec 7, 2025

I learned that the hard way, setting <sendEventsMode>no</sendEventsMode>.

If I understood the code correctly it should provide a method to set at least the general device (e.g. different scroll factors per mouse or touchpad). And adding a method to not write anything instead of writing "no"?

In LXQt x11 we can set it per different mouse devices which are chosen by a dropdown, here my touchpad shows up also as mouse though.

ELAN1200%253A00%252004F3%253A309F%2520Mouse\accelSpeed=0.699999988079071
ELAN1200%253A00%252004F3%253A309F%2520Mouse\naturalScrollingEnabled=0
ELAN1200%253A00%252004F3%253A309F%2520Mouse\scrollingMethodEnabled=4
ELAN1200%253A00%252004F3%253A309F%2520Mouse\tapToDragEnabled=-1
ELAN1200%253A00%252004F3%253A309F%2520Mouse\tappingEnabled=-1
ELAN1200%253A00%252004F3%253A309F%2520Touchpad\accelSpeed=0.8999999761581421
ELAN1200%253A00%252004F3%253A309F%2520Touchpad\naturalScrollingEnabled=0
ELAN1200%253A00%252004F3%253A309F%2520Touchpad\scrollingMethodEnabled=1
ELAN1200%253A00%252004F3%253A309F%2520Touchpad\tapToDragEnabled=1
ELAN1200%253A00%252004F3%253A309F%2520Touchpad\tappingEnabled=1
FTCS1000%253A01%25202808%253A0102%2520Mouse\accelSpeed=0
FTCS1000%253A01%25202808%253A0102%2520Mouse\naturalScrollingEnabled=0
FTCS1000%253A01%25202808%253A0102%2520Mouse\scrollingMethodEnabled=4
FTCS1000%253A01%25202808%253A0102%2520Mouse\tapToDragEnabled=-1
FTCS1000%253A01%25202808%253A0102%2520Mouse\tappingEnabled=-1
FTCS1000%253A01%25202808%253A0102%2520Touchpad\accelSpeed=0.699999988079071
FTCS1000%253A01%25202808%253A0102%2520Touchpad\naturalScrollingEnabled=0
FTCS1000%253A01%25202808%253A0102%2520Touchpad\scrollingMethodEnabled=1
FTCS1000%253A01%25202808%253A0102%2520Touchpad\tapToDragEnabled=1
FTCS1000%253A01%25202808%253A0102%2520Touchpad\tappingEnabled=1
ImPS%252F2%2520Generic%2520Wheel%2520Mouse\accelSpeed=0
ImPS%252F2%2520Generic%2520Wheel%2520Mouse\naturalScrollingEnabled=0
ImPS%252F2%2520Generic%2520Wheel%2520Mouse\scrollingMethodEnabled=0
ImPS%252F2%2520Generic%2520Wheel%2520Mouse\tapToDragEnabled=-1
ImPS%252F2%2520Generic%2520Wheel%2520Mouse\tappingEnabled=-1

Edit: missed your first comment.

Was then going to start looking at supporting 'objects' (e.g. keybinds, mousebinds and libinput configuration for different type of devices).

Now that I'm a little familiar with the code I'd like to continue, adding settings which seem already possible with the current implementation (e.g. snapping, foucs, keyboard repeat, mouse double click and so on), but should I better wait?

@stefonarch
Copy link
Contributor Author

Oh, I selected the wrong thing with the merge conflict in the GUI here

@johanmalm
Copy link
Member

Now that I'm a little familiar with the code I'd like to continue, adding settings which seem already possible with the current implementation (e.g. snapping, foucs, keyboard repeat, mouse double click and so on), but should I better wait?

Go for it.

I've got a lot of stuff I want to sort out, but I feel sure we can do that in parallel without treading on each others toes.

@johanmalm
Copy link
Member

In LXQt x11 we can set it per different mouse devices which are chosen by a dropdown, here my touchpad shows up also as mouse though.

Do you have a screenshot of what that looks like?

It's not obvious to me what GUI best suits <libinput> to avoid having to re-do it in future. I had been thinking something like this: https://doc.qt.io/qt-6/qtwidgets-itemviews-editabletreemodel-example.html but it might be overkill.

Also, I don't think it's straight forward to get individual devices names without root privileges. I think I'm right in saying that a compositor can get the names, but not clients.

@stefonarch
Copy link
Contributor Author

To be honest I don't think that the LXQt X11 Gui is very well done and to imitate, as it has twice mouse settings, this is with a wireless mouse and a touchpad...

immagine

IMO niri has a good implementation/overview which I used in niri-settings
https://yalter.github.io/niri/Configuration%3A-Input.html

I''ve never tested but it could be that changing the mouse in x11 here would mean having the defaults again... so just per category should be enough or even better. For the keyboard it could make sense to have it maybe.

@stefonarch
Copy link
Contributor Author

If we could use later just ui->pointerSpeed->setValue(getFloat("/labwc_config/libinput/device/mouse/pointerSpeed"));

ui->pointerSpeed->setValue(getFloat("/labwc_config/libinput/device/touchpad/pointerSpeed"));

would be enough IMO.

@johanmalm
Copy link
Member

/labwc_config/libinput/device/touchpad/pointerSpeed

If we could use later just ui->pointerSpeed->setValue(getFloat("/labwc_config/libinput/device/mouse/pointerSpeed"));

ui->pointerSpeed->setValue(getFloat("/labwc_config/libinput/device/touchpad/pointerSpeed"));

would be enough IMO.

Yes, supporting separate settings for touchpads and mice is probably a good balance. The nodenames would be slightly different to what you've done above though unless we change labwc. We will have to think 'object' rather than 'key=value' pair.

So what's the plan, shall we work on merging this PR with its current approach for now?

I could do a list of stuff I think needs to get sorted before we tag the first revision if helpful.

@johanmalm
Copy link
Member

@stefonarch See #145

@stefonarch
Copy link
Contributor Author

@stefonarch See #145

Hu, seems quite some work. But yes, more things that can be exposed in the GUI is worth the effort.

So what's the plan, shall we work on merging this PR with its current approach for now?

I'm fine with this, we say "better a small bird in the hand than a big one on the roof" ;)

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