From: Ulf Brosziewski Subject: Re: wsconsctl mouse.tp.scaling is useful for normal mice as well To: robert@openbsd.org, miod@openbsd.org, tech@openbsd.org Date: Mon, 16 Sep 2024 21:45:14 +0200 Hi, is the additional field really that useful? That's not a rhetorical question, I'm not sure what to make of it. It's true that the scaling parameters can apply to mouse input in the same way as to touchpads in compat mode - and handling them as "touchpad-specific" is a bit misleading -, but there is a difference: wsmouse initializes the scaling parameters for touchpads, based on some magic inspired by synaptics(4) code. Without that initialization, many touchpads wouldn't be usable out-of-the-box. For mice, such an initialization is unnecessary and impossible. Users who want to tweak the pointer speed can also do that by manipulating some X settings. When I wrote that wsconsctl code, I wasn't sure whether the initialization magic would work for most or all touchpads, and that's the reason why the 'scaling' field is in the "mouse.tp.*" group. Will it be immediately clear to users that a zero value in the new field means "uninitialized and ignored" rather than "scaled by 0.0"? If not, the printing routine should replace zero values by 1.0. The new field and the change of the 'tp.scaling' flags might require an update of the wsmouse man page. BTW, it seems that your patch replaces tabs with spaces, and I'd prefer to have the mouse.* fields grouped together, rather than mixed with the mouse.tp.* fields. On 9/15/24 18:05, Christopher Zimmermann wrote: > Hi, > > mouse.tp.scaling is at least as useful for normal mice as it is for touchpanels. Therefore add an alias available for all wsmouse devices. Hide the original tp.scaling option by making in write-only. > > OK? > > Christopher > > > Index: mouse.c > =================================================================== > RCS file: /cvs/src/sbin/wsconsctl/mouse.c,v > retrieving revision 1.21 > diff -u -p -r1.21 mouse.c > --- mouse.c     2 Jul 2023 21:44:04 -0000       1.21 > +++ mouse.c     15 Sep 2024 16:03:50 -0000 > @@ -58,13 +58,14 @@ struct field mouse_field_tab[] = { >      /* touchpad-specific options: */ >      { "tp.tapping",            &cfg_tapping,   FMT_CFG,        FLG_NORDBACK }, >      { "tp.mtbuttons",          &cfg_mtbuttons, FMT_CFG,        FLG_NORDBACK }, > -    { "tp.scaling",            &cfg_scaling,   FMT_CFG,        FLG_NORDBACK }, > +    { "tp.scaling",            &cfg_scaling,   FMT_CFG,        FLG_NORDBACK | FLG_WRONLY }, >      { "tp.swapsides",          &cfg_swapsides, FMT_CFG,        FLG_NORDBACK }, >      { "tp.disable",            &cfg_disable,   FMT_CFG,        FLG_NORDBACK }, >      { "tp.edges",              &cfg_edges,     FMT_CFG,        FLG_NORDBACK }, >      { "tp.param",              &cfg_param,     FMT_CFG,        FLG_WRONLY }, > -    /* Add an alias.  This field is valid for all wsmouse devices. */ > +    /* Add aliases.  These fields are valid for all wsmouse devices. */ >      { "param",                 &cfg_param,     FMT_CFG,        FLG_WRONLY }, > +    { "scaling",               &cfg_scaling,   FMT_CFG,        FLG_NORDBACK }, >      { NULL } >  }; > > @@ -106,6 +107,7 @@ mouse_init(int devfd, int devidx) { >                 for (f = mouse_field_tab; f->name != NULL; f++) >                         if (f->format == FMT_CFG) { >                                 if (f->valp != &cfg_param > +                                   && f->valp != &cfg_scaling >                                     && f->valp != &cfg_revscroll) >                                         f->flags |= FLG_DEAD; >                                 else