[PATCH libinput 2/2] touchpad: reduce button size, use physical sizes where possible

Hans de Goede hdegoede at redhat.com
Wed Jul 2 03:09:55 PDT 2014


Hi,

On 07/02/2014 08:49 AM, Peter Hutterer wrote:
> The current 20% is excessive. On the t440s, the button size amounts to ~14mm
> from the bottom. On the x220 it amounts to ~9mm, leaving only 31mm as actual
> touchpad.
> 
> Reduce it to 15% instead, which amounts to 10.5mm on the t440 and 6mm on the
> x220. Cap the button height further by making buttons a maximum height of
> 10mm, anything larger than that is excessive anyway.
> 
> Smaller buttons should be acceptable since we can rely on the bottom edge to
> be a haptic feedback and thus a good hit-target, somewhat simliar to how
> screen edges are good hit-targets.
> 
> The top software buttons stay the same size, but prefer a physical size of 6mm
> instead (which is 1mm below the button marker line on the T440s). If no y
> resolution is available, fall back to the 8% which is 5.6mm on the T440s.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
> 10mm height doesn't sound like much at first, but given a normal finger
> position that's still quite large and easy to hit. The normal touch point
> for a finger is not the top of the finger, but rather a fair bit back, that
> X in this incredibly photo-realistic ASCII-art:
> 	       _____
>   |           //   \\               |
>   |           \\_X__\\              |
>   |            \      \             |
>   +-------------\      \-----------+

Oh, pretty ascii art :)

Looks good:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> 
> 
>  src/evdev-mt-touchpad-buttons.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
> index 68b25dc..0957d03 100644
> --- a/src/evdev-mt-touchpad-buttons.c
> +++ b/src/evdev-mt-touchpad-buttons.c
> @@ -564,11 +564,28 @@ tp_init_buttons(struct tp_dispatch *tp,
>  	if (tp->buttons.is_clickpad && !tp->buttons.use_clickfinger) {
>  		int xoffset = absinfo_x->minimum,
>  		    yoffset = absinfo_y->minimum;
> -		tp->buttons.bottom_area.top_edge = height * .8 + yoffset;
> +		int yres = absinfo_y->resolution;
> +
> +		/* button height: 10mm or 15% of the touchpad height,
> +		   whichever is smaller */
> +		if (yres > 1 && (height * 0.15/yres) > 10) {
> +			tp->buttons.bottom_area.top_edge =
> +				absinfo_y->maximum - 10 * yres;
> +		} else {
> +			tp->buttons.bottom_area.top_edge = height * .85 + yoffset;
> +		}
> +
>  		tp->buttons.bottom_area.rightbutton_left_edge = width/2 + xoffset;
>  
>  		if (tp->buttons.has_topbuttons) {
> -			tp->buttons.top_area.bottom_edge = height * .08 + yoffset;
> +			/* T440s has the top button line 5mm from the top,
> +			   make the buttons 6mm high */
> +			if (yres > 1) {
> +				tp->buttons.top_area.bottom_edge =
> +					yoffset + 6 * yres;
> +			} else {
> +				tp->buttons.top_area.bottom_edge = height * .08 + yoffset;
> +			}
>  			tp->buttons.top_area.rightbutton_left_edge = width * .58 + xoffset;
>  			tp->buttons.top_area.leftbutton_right_edge = width * .42 + xoffset;
>  		} else {
> 


More information about the wayland-devel mailing list