termux / termux-x11

Termux X11 add-on application.
https://termux.dev
GNU General Public License v3.0
1.85k stars 290 forks source link

chore: send mouse move via lorieMouseRelative device #601

Closed KawaiiNahida closed 4 months ago

twaik commented 4 months ago

Did you see the e.mouse.relative condition? It checks if event was sent to relative device or not. It exists for a reason. And making code explicitly ignore this is not a option.

KawaiiNahida commented 4 months ago

Did you see the e.mouse.relative condition? It checks if event was sent to relative device or not. It exists for a reason. And making code explicitly ignore this is not a option.

I admit it's obviously not a good solution, but the current behavior of sending mouse scroll and movement via different devices causes the scroll to stop working when the mouse moves even slightly in most applications, it's so annoying.

I tried sending BUTTON_SCROLL to different devices, but I only received "RawMotion", and it seems that the applications do not respond to that. Additionally, I discovered that some devices' built-in touchpad gestures stop working when the pointer is captured by an app (for example, miui devices), and I will have to switch the pointer capture mode each time I switch between the mouse and built-in touchpad.

I've been running the modified version for almost a day and haven't found anything goes wrong with it, which is why I submitted the PR. I would appreciate it if there were other good solutions to solve this problem.

twaik commented 4 months ago

but the current behavior of sending mouse scroll and movement via different devices causes the scroll to stop working when the mouse moves even slightly in most applications, it's so annoying.

I'll take a look later.

I discovered that some devices' built-in touchpad gestures stop working when the pointer is captured by an app

They do not "stop working". Capturing pointer forces Android to send raw events to application. Which means application must handle all events and implement behaviour of touchpad not relying on OS behaviour.

I could fix this but I have no devices with real touchpads and do not have enough power or time for this.