virresh / matvt

Virtual Mouse for Android TV that can be controlled via remote itself.
GNU General Public License v3.0
211 stars 35 forks source link

Mouse/Scroll combination #21

Closed BraneI closed 2 years ago

BraneI commented 2 years ago

Would it be possible to scroll up when the mouse hits the bottom border of the screen and to start scrolling down when the mouse hits the upper border of the screen?

This would eliminate the need to constantly switch between Mouse and D-Pad mode in the web browsers (like Chrome). Also, scrolling left and right on the right and left border would be useful inside some applications.

virresh commented 2 years ago

Hi @BraneI Thank you for the suggestion, and this request has indeed come up before as well, but it runs into a big problem, without knowing cursors exact position.

Consider a web page similar to the following: image

There are two horizontal scrollable windows. Which one should be scrolled when the cursor hits border, top one or the bottom one? How do we know determine it without exact pointer location? There could be several such vertical / horizontal scrollables in a viewport, it's impossible for the mouse to know where to scroll if it doesn't know what to focus on.

If there is a deterministic solution to the above problem, I'd be happy to accept a PR 😄

Let me know if this solves your query.

BraneI commented 2 years ago

Hello @virresh ,

Thank you for your fast response.

I understand that scrolling on the mouse hitting the screen border will not resolve all problems and that is why I am not proposing that this option replace the scroll mode. However, it should always work on the main form by scrolling the whole page (not just one page element).

virresh commented 2 years ago

@BraneI unfortunately there are extreme technical limitations on the use-case you've presented. I'd consider this as a good to have, but accessibility APIs don't have a way to know what is the main form in a given view. Think of the cursor as a finger that helps swipe virtually

Computing main form in a given viewport is unreliable and likely to fail for 90% of apps. However, I'm open to community contributions. Marking this issue as help wanted, just in case someone would like to contribute this feature.

virresh commented 2 years ago

Hi @BraneI We have a community contributed feature for auto-scroll on hitting the screen border

Please checkout v1.0.6 - https://github.com/virresh/matvt/releases/tag/v1.0.6

Closing this issue. Feel free to re-open and comment in case of more feedback