Skip to content

expose inverted horizontal scroll API configuration option

0xfMel requested to merge 0xfMel/libinput:config-invert-horizontal-scroll into main

Adds inverted horizontal scroll API config option with

  • libinput_device_config_scroll_get_inverted_horizontal_scroll_enabled
  • libinput_device_config_scroll_has_inverted_horizontal_scroll
  • libinput_device_config_scroll_set_inverted_horizontal_scroll_enabled functions

While I understand config options are avoided, as stated in the FAQ, I was surprised to find this wasn't an option when I wanted to find it. I believe this to be more than just a device quirk, but can be a user preference too. Furthermore, device quirks are unable to differentiate between shared input USB devices. e.g. Logitech's Bolt Receiver. This means the only option for a user wanting to change this setting for such devices is to create their own custom quirk, which feels like a hack.

This was implemented in a similar way to natural scroll, the difference being the term "invert" is relative to the default value, so setting the inverted option will always swap the default value. For this reason I didn't include the get_default API. Unsure about whether this was the right way to go about it so please advise. I'd like it to be more consistent but having the default value exposed through the API feels confusing and much less useful.

  • adds similar tests to natural scroll with new LISTEST_HWHEEL feature flag
  • adds inverted horizontal scroll debug information to list-devices and debug-events
  • adds (enable/disable)-inverted-horizontal-scrolling options to tools

Wasn't sure about the commit message prefix.

Merge request reports