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

Rationalise input configuration options #3432

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

AlanGriffiths
Copy link
Contributor

Let's tidy up before we release 2.18 with them

@AlanGriffiths AlanGriffiths requested a review from a team as a code owner June 19, 2024 17:08
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 54.40000% with 57 lines in your changes missing coverage. Please review.

Project coverage is 77.23%. Comparing base (688d231) to head (ded4f92).
Report is 13 commits behind head on main.

Files Patch % Lines
src/miral/input_device_config.cpp 63.33% 33 Missing ⚠️
src/server/input/default_input_device_hub.cpp 31.57% 13 Missing ⚠️
src/common/input/mir_touchpad_config.cpp 26.66% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3432      +/-   ##
==========================================
- Coverage   77.24%   77.23%   -0.01%     
==========================================
  Files        1071     1071              
  Lines       68467    68483      +16     
==========================================
+ Hits        52885    52893       +8     
- Misses      15582    15590       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

While here, how about a reference page for input configuration?

Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

I believe we're missing:

include/common/mir/input/mir_touchpad_config.h Outdated Show resolved Hide resolved
@AlanGriffiths
Copy link
Contributor Author

While here, how about a reference page for input configuration?

I first want consensus on the naming

Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

  --mouse-scroll-speed-scale arg        Scales mice scroll events, use negative
                                        values for natural scrolling
  --touchpad-scroll-speed-scale arg     Scales touchpad scroll events, use 
                                        negative values for natural scrolling

-speed-scale is a mouthful… -speed alone? -factor? Could also use a note on accepted values.

@Saviq
Copy link
Collaborator

Saviq commented Jun 20, 2024

For reference, this is the full current --help output:

  --mouse-cursor-acceleration arg       Select acceleration profile for mice   
                                        and trackballs [none, adaptive]
  --mouse-cursor-acceleration-bias arg  Constant factor (+1) to velocity or 
                                        bias to the acceleration curve within 
                                        the range [-1.0, 1.0] for mice
  --mouse-scroll-speed-scale arg        Scales mice scroll events, use negative
                                        values for natural scrolling
  --touchpad-disable-while-typing arg   Disable touchpad while typing on    
                                        keyboard configuration [true, false]   
  --touchpad-tap-to-click arg           Enable or disable tap-to-click on this 
                                        device, with a default mapping of 1, 2,
                                        3 finger tap mapping to left, right, 
                                        middle click, respectively [true,      
                                        false]     
  --touchpad-cursor-acceleration arg    Select acceleration profile for 
                                        touchpads [none, adaptive]             
  --touchpad-cursor-acceleration-bias arg                                                                                  
                                        Constant factor (+1) to velocity or 
                                        bias to the acceleration curve within 
                                        the range [-1.0, 1.0] for touchpads
  --touchpad-scroll-speed-scale arg     Scales touchpad scroll events, use 
                                        negative values for natural scrolling
  --touchpad-scroll-mode arg            Select scroll mode for touchpads: 
                                        [edge, two-finger, button-down]
  --touchpad-click-mode arg             Select click mode for touchpads: 
                                        [{area, finger-count}]
  --touchpad-middle-mouse-button-emulation arg
                                        Converts a simultaneous left and right 
                                        button click into a middle button

@Saviq
Copy link
Collaborator

Saviq commented Jun 20, 2024

  --touchpad-tap-to-click arg           Enable or disable tap-to-click on this 
                                        device, with a default mapping of 1, 2,

Should we say default, if there's no way to change that?

@Saviq
Copy link
Collaborator

Saviq commented Jun 20, 2024

And the corresponding logs:

Apple Inc. Apple Internal Keyboard / Trackpad, capabilities={keyboard|alpha_numeric}
bcm5974, capabilities={pointer|touchpad}, pointer_config={handedness=right,cursor-acceleration=adaptive,cursor-acceleration-bias=0.00,scroll-hscale=1.00,scroll-vscale=1.00}, touchpad_config={click-mode=finger-count|scroll-mode=two-finger|disable-while-typing}
Logitech Wireless Mouse, capabilities={pointer}, pointer_config={handedness=right,cursor-acceleration=none,cursor-acceleration-bias=1.00,scroll-hscale=1.00,scroll-vscale=1.00}
Logitech Wireless Keyboard PID:4023, capabilities={keyboard|alpha_numeric}

@Saviq
Copy link
Collaborator

Saviq commented Jun 20, 2024

We have scroll scale split into vertical and horizontal in the log (and calling it just scroll-scale, no -speed), but we only allow a single value input. Do we want to do anything about that?

@Saviq
Copy link
Collaborator

Saviq commented Jun 20, 2024

  --touchpad-click-mode arg             Select click mode for touchpads: 
                                        [{area, finger-count}]

Why the curly braces?

Also, libinput calls this "clickfinger" rather than "finger-count", we probably should stay close to their nomenclature?

Base automatically changed from log-input-devices to main June 20, 2024 12:52
@AlanGriffiths
Copy link
Contributor Author

We have scroll scale split into vertical and horizontal in the log (and calling it just scroll-scale, no -speed), but we only allow a single value input. Do we want to do anything about that?

Do you have a preference? I'd go for specifying vspeed and hspeed but...

@AlanGriffiths
Copy link
Contributor Author

AlanGriffiths commented Jun 21, 2024

disable-while-trackpointing would mean changing mir::input::TouchpadSettings - which is a (badly designed for stability) part of the platform ABI. Not sure we want that now

Copy link
Collaborator

@Saviq Saviq left a comment

Choose a reason for hiding this comment

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

Do you have a preference? I'd go for specifying vspeed and hspeed but...

I suppose there could be devices that have different default scroll speeds on the two axes, so we should keep it?

And we could accept a float or a tuple of floats?

src/miral/input_device_config.cpp Show resolved Hide resolved
Comment on lines 50 to 59
char const* const mouse_scroll_speed_scale_opt = "mouse-scroll-speed-scale";
char const* const mouse_vscroll_speed_opt = "mouse-scroll-vspeed";
char const* const mouse_hscroll_speed_opt = "mouse-scroll-hspeed";
char const* const touchpad_cursor_acceleration_opt = "touchpad-cursor-acceleration";
char const* const touchpad_cursor_acceleration_bias_opt = "touchpad-cursor-acceleration-bias";
char const* const touchpad_scroll_speed_scale_opt = "touchpad-scroll-speed-scale";
char const* const touchpad_vscroll_speed_opt = "touchpad-vscroll-speed";
char const* const touchpad_hscroll_speed_opt = "touchpad-hscroll-speed";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh no, don't like that… 99% just need the same scale for both h/v, I'd rather stick to a single float, or maybe:

--mouse-scroll-speed {<hvscale>|<hscale>,<vscale>}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe: use --mouse-scroll-speed for both unless --mouse-horizontal-scroll-speed-override is also set?

Copy link
Collaborator

Choose a reason for hiding this comment

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

But then… what if you only need vscroll changed? I suppose my proposal also forced you to give both, but in a more obvious way…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe: use --mouse-scroll-speed for both unless --mouse-horizontal-scroll-speed-override and/or --mouse-vertical-scroll-speed-override is also set?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And what if you set both -overrides, but not -speed? XD

My vote is on the above, but maybe with "x" as separator.

--mouse-scroll-speed {<hvscale>|<hscale>x<vscale>}
# e.g.
--mouse-scroll-speed 1.2
--mouse-scroll-speed -2
--mouse-scroll-speed 1x-1
--mouse-scroll-speed -1.2x2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"But then… what if you only need vscroll changed?"

Copy link
Collaborator

Choose a reason for hiding this comment

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

Still nicer IMO than the -vertical-override option…

--mouse-scroll-speed 1x2
# or, but I don't think so, certainly not with `x` as separator
--mouse-scroll-speed x2
--mouse-scroll-speed 2x

Actually, there's one thing that needs consideration - in theory devices could have different defaults? So it may be important to have a way to only specify one axis? Or will the default always be 1.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is always 1F, it isn't something libinput implements

@Saviq
Copy link
Collaborator

Saviq commented Jun 26, 2024

This is how things look now:

  --mouse-handedness arg                Select mouse laterality: [right, left]
  --mouse-cursor-acceleration arg       Select acceleration profile for mice 
                                        and trackballs [none, adaptive]   
  --mouse-cursor-acceleration-bias arg  Constant factor (+1) to velocity or 
                                        bias to the acceleration curve within 
                                        the range [-1.0, 1.0] for mice
  --mouse-scroll-vspeed arg             Scales mouse vertical scroll, use 
                                        negative values for natural scrolling  
  --mouse-scroll-hspeed arg             Scales mouse horizontal scroll, use 
                                        negative values for natural scrolling
  --touchpad-disable-while-typing arg   Disable touchpad while typing on 
                                        keyboard configuration [true, false]
  --touchpad-disable-with-external-mouse arg                                                                                       
                                        Disable touchpad if an external pointer
                                        device is plugged in [true, false]  
  --touchpad-tap-to-click arg           Enable or disable tap-to-click on this 
                                        device, with 1, 2, 3 finger tap mapping
                                        to left, right, middle click,  
                                        respectively [true, false]  
  --touchpad-cursor-acceleration arg    Select acceleration profile for        
                                        touchpads [none, adaptive]
  --touchpad-cursor-acceleration-bias arg                
                                        Constant factor (+1) to velocity or    
                                        bias to the acceleration curve within 
                                        the range [-1.0, 1.0] for touchpads
  --touchpad-vscroll-speed arg          Scales touchpad vertical scroll, use 
                                        negative values for natural scrolling
  --touchpad-hscroll-speed arg          Scales touchpad horizontal scroll, use 
                                        negative values for natural scrolling
  --touchpad-scroll-mode arg            Select scroll mode for touchpads: 
                                        [edge, two-finger, button-down]
  --touchpad-click-mode arg             Select click mode for touchpads: [none,
                                        area, clickfinger]
  --touchpad-middle-mouse-button-emulation arg
                                        Converts a simultaneous left and right 
                                        button click into a middle button

@Saviq Saviq requested a review from RAOF June 26, 2024 17:16
@AlanGriffiths AlanGriffiths force-pushed the MIRENG-577/rationalise-input-config-options branch from 83f8650 to 102c89f Compare June 27, 2024 09:25
Copy link
Contributor

@RAOF RAOF left a comment

Choose a reason for hiding this comment

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

I think there are a couple of options that could be improved with the grammatical suggestions, and a couple of other things, but in the broad strokes this option scheme looks sensible to me.

src/miral/input_device_config.cpp Outdated Show resolved Hide resolved
src/miral/input_device_config.cpp Outdated Show resolved Hide resolved
src/miral/input_device_config.cpp Outdated Show resolved Hide resolved
src/miral/input_device_config.cpp Outdated Show resolved Hide resolved
src/miral/input_device_config.cpp Outdated Show resolved Hide resolved
@AlanGriffiths
Copy link
Contributor Author

This is how these options now look:

  --mouse-handedness arg                Select mouse laterality: [right, left]
  --mouse-cursor-acceleration arg       Select acceleration profile for mice 
                                        and trackballs [none, adaptive]
  --mouse-cursor-acceleration-bias arg  Set the pointer acceleration speed of 
                                        mice within a range of [-1.0, 1.0]
  --mouse-scroll-speed arg              Scales mouse scroll. Use negative 
                                        values for natural scrolling
  --mouse-horizontal-scroll-speed-override arg
                                        Scales mouse horizontal scroll. Use 
                                        negative values for natural scrolling
  --mouse-vertical-scroll-speed-override arg
                                        Scales mouse vertical scroll. Use 
                                        negative values for natural scrolling
  --touchpad-disable-while-typing arg   Disable touchpad while typing on 
                                        keyboard configuration [true, false]
  --touchpad-disable-with-external-mouse arg
                                        Disable touchpad if an external pointer
                                        device is plugged in [true, false]
  --touchpad-tap-to-click arg           Enable or disable tap-to-click on this 
                                        device, with 1, 2, 3 finger tap mapping
                                        to left, right, middle click, 
                                        respectively [true, false]
  --touchpad-cursor-acceleration arg    Select acceleration profile for 
                                        touchpads [none, adaptive]
  --touchpad-cursor-acceleration-bias arg
                                        Set the pointer acceleration speed of 
                                        touchpads within a range of [-1.0, 1.0]
  --touchpad-scroll-speed arg           Scales touchpad scroll. Use negative 
                                        values for natural scrolling
  --touchpad-horizontal-scroll-speed-override arg
                                        Scales touchpad horizontal scroll. Use 
                                        negative values for natural scrolling
  --touchpad-vertical-scroll-speed-override arg
                                        Scales touchpad vertical scroll. Use 
                                        negative values for natural scrolling
  --touchpad-scroll-mode arg            Select scroll mode for touchpads: 
                                        [edge, two-finger, button-down]
  --touchpad-click-mode arg             Select click mode for touchpads: [none,
                                        area, clickfinger]
  --touchpad-middle-mouse-button-emulation arg
                                        Converts a simultaneous left and right 
                                        button click into a middle button

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.

None yet

3 participants