termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
36.45k stars 3.83k forks source link

Add support for mouse gestures. #35

Open Neo-Oli opened 8 years ago

Neo-Oli commented 8 years ago

In certain programs you can use mouse gestures to do various tasks, for example:

This works when connecting to termux via SSH from a computer with mouse but it does not work when using the termux app. I realize that this would cause a conflict with the swipe to scroll feature, but maybe we can come up with a solution that can incorporate both these features. Some ways I came up with:

Maybe someone has a better idea?

fornwall commented 8 years ago

What do you think about doing the following for programs enabling terminal mouse events?

  1. One finger down and dragging: Treat as mouse button down and dragging mouse.
  2. Two fingers down and dragging: Treat as mouse wheel scroll events (this is what is currently done now regardless of fingers down).
Neo-Oli commented 8 years ago

I like it, but then it should probably be an optional configuration. A first time user would probably be confused and it might be annoying for people who don't use programs with mouse dragging.

sunziping2016 commented 8 years ago

I also need this feature. :-) It can really help a lot if I can drag the window easily (as well as selecting text).

sunziping2016 commented 8 years ago

I am now tring to add this feature by myself and I treate double tap and drag as mouse click down and drag. It seems awesome. I am going to do some further test.

galets commented 2 years ago

If there is a way to tell that there is a physical mouse connected to device, and mouse events are coming from that physical mouse, then these could be handled differently. This would allow using mouse for some nice UI usability features, the one I would really love to have is a linux-style mouse select and copy/paste in the terminal

navid-zamani commented 2 years ago

I think the most refined way to implement this, is doing exactly what touchpads on laptops offer. It rests on decades of experience on what works best.

They have many variations, some more and some less annoying. My favorite ”average Joe“ one is:

I highly second configurability too. Look at how many options and ways to use it even the basic touchpad implementation e.g. on Linux Mint has. Lets everyone be happy, which is nice. :)

navid-zamani commented 2 years ago

@galets: The standard Unix way is that the different input devices are different (character) device files. You have the software read from the device file you want to use as input. This could be done by the terminal, or by the program running inside it itself. You can cat /dev/input/event* on Linux and watch the data mess up your terminal as you move the mouse. ;) Of course Android, as the saying goes, will fail to understand Unix, and reimplement it, badly, again. ^^ And /dev is not accessible to Termux anyway without root. (Damn n00bs! *shakes fist* :D) The above is the general principle for Linux programs too though.

trygveaa commented 2 years ago

I think the most refined way to implement this, is doing exactly what touchpads on laptops offer. It rests on decades of experience on what works best.

I don't think that's a good idea, touchpads are typically used with the index finger so it's easy to use multiple fingers. Phones however are usually used with the thumb, so multi-finger operations are more inconvenient. I would assume scrolling in the terminal is used way more than hovering (which is pretty niche in a terminal), so having to use three fingers for scrolling while one finger is for hovering would be wildly inconvenient.