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

Feature: Alternate selection mode for easier touchpad usage? #76

Open
wisp3rwind opened this issue Nov 7, 2020 · 7 comments · May be fixed by #143
Open

Feature: Alternate selection mode for easier touchpad usage? #76

wisp3rwind opened this issue Nov 7, 2020 · 7 comments · May be fixed by #143

Comments

@wisp3rwind
Copy link
Contributor

I rarely use my computer with a physical mouse attached, so I need to use the touchpad to make selections. When selecting larger regions, the click-drag-release method of defining the region often doesn't work well (even when pointer movement is configured quite fast). Would you consider adding an alternative mode (i.e. a CLI option to switch to it) where the first click/tap sets the first corner, then the cursor could be moved freely with no button held, and the second corner would only be set after a second click/tap?

As with my other feature request, I might look into implementing it myself. I've essentially no knowledge of sway/slurp/wayland internals, though, so if someone else would go ahead, I'd appreciate it a lot. Thanks!

@maximbaz
Copy link

maximbaz commented Nov 7, 2020

I agree with the problem but I would like to propose an alternative solution to it: how about we keep click-drag-release mode, but allow to correct it? In other words, you draw an initial rectangle, once you release the button slurp doesn't immediately exit but keeps the rectangle drawn, you can then grab it by any edge and continue resizing, and only after pressing Enter slurp exits and prints the dimensions of the final rectangle. This way you don't have to be precise on the first try (not with dragging, nor with clicking on two points), and at the same slurp doesn't have to have two completely different modes of operation (click-drag-release and click-release-click-release).

What do you think?

@wisp3rwind
Copy link
Contributor Author

That sounds quite useful, too! Without a prototype, it's probably hard to tell which approach works out better. My approach would have the advantage that I don't need to double-tap when selecting the first point. On the other hand, I agree that your idea integrates better with the current behaviour. It would also open the way to use keybindings to modify the selection.

@emersion
Copy link
Owner

I'm a little worried about feature creep here. I'd like to keep slurp relatively simple, it seems like adding alternate modes or the ability to amend the selection would make it significantly more complicated.

@wisp3rwind
Copy link
Contributor Author

Yeah, I see your point. In particular, having two alternate modes which are switched by a CLI option doesn't really sound ideal to me either.

@cristobaltapia
Copy link

cristobaltapia commented Apr 4, 2021

Maybe a key can be configured to act as alternative mouse click? That way you can hold the key while you are drawing with the touchpad.

@layus
Copy link

layus commented Jan 24, 2022

Or maybe make Ctrl preserve the selection until it is released ? A key would also move the behavior switch away from the cli options.

@RyanGibb
Copy link

It's not ideal, but this script to convert 2 points to a region may be of use to some people:

#!/usr/bin/env bash

set -o pipefail

point="$(slurp -p | cut -d \  -f 1)" || exit

IFS=',' read -ra coord <<< "$point"
x1="${coord[0]}"
y1="${coord[1]}"

point="$(slurp -p | cut -d \  -f 1)" || exit

IFS=',' read -ra coord <<< "$point"
x2="${coord[0]}"
y2="${coord[1]}"

if (($x1 < $x2)); then
	x_size=$(($x2 - $x1))
	x=$x1
else
	x_size=$(($x1 - $x2))
	x=$x2
fi

if (($y1 < $y2)); then
	y_size=$(($y2 - $y1))
	y=$y1
else
	y_size=$(($y1 - $y2))
	y=$y2
fi

echo $x,$y ${x_size}x$y_size

Grillo-0 added a commit to Grillo-0/slurp that referenced this issue Oct 29, 2023

Unverified

This user has not yet uploaded their public signing key.
Clicking and dragging to create a selection could be bit cumbersome
when using a touch-pad.

Add an option to switch to a mode that you click to start a selection,
and click again to end it.

Fixes: emersion#76
@Grillo-0 Grillo-0 linked a pull request Oct 29, 2023 that will close this issue
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 a pull request may close this issue.

6 participants