termux / termux-x11

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

Issue that reverses touchpad axis when setting "Capture external mouse when possible" #403

Closed hansm629 closed 1 year ago

hansm629 commented 1 year ago

오류1

If you set the "Capture external mouse when possible" toggle switch to on

There is an issue where the touchpad direction of the Galaxy Tab S8+ keyboard cover is reversed.

This is a symptom reference video.

https://github.com/termux/termux-x11/assets/101167173/bb11d636-6507-4baa-885d-75f08ae1c5cb

Additionally, the gesture on the touchpad doesn't work on Termux-x11, so I was wondering if there was a way to make it work.

twaik commented 1 year ago

It looks like Android performs some event coordinates transformation which is not applied to captured events. It is some device-specific bug.

hansm629 commented 1 year ago

It looks like Android performs some event coordinates transformation which is not applied to captured events. It is some device-specific bug.

Is it possible to improve?

twaik commented 1 year ago

I am not sure.

hansm629 commented 1 year ago

I think I can help you if you need a separate test.

twaik commented 1 year ago

You can install this apk and start termux-x11 with TERMUX_X11_DEBUG=1. I have a theory.

twaik commented 1 year ago

I need the log

twaik commented 1 year ago

Any updates?

hansm629 commented 1 year ago

Any updates?

I'm sorry for the late reply. I just checked because I finished work late.

Downloaded and installed. How do I pull the log file?

twaik commented 1 year ago

https://github.com/termux/termux-x11#logs

hansm629 commented 1 year ago

https://github.com/termux/termux-x11#logs

Log information.

``` 08-01 00:39:09.747 22947 22947 D EVENT : handleTouchEvent: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=860.0, y[0]=1572.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196117, downTime=395195953, deviceId=7, source=0x1002, displayId=0, eventId=882027768 } orientation -1.5707964 screen 1 08-01 00:39:10.070 22947 22947 D EVENT : handleCapturedEvent: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=1407.0, y[0]=143.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196434, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=456658728 } orientation 0.0 screen 1 08-01 00:39:10.070 22947 22947 D EVENT : handleTouchEvent: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=1407.0, y[0]=143.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196434, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=456658728 } orientation 0.0 screen 1 08-01 00:39:10.082 22947 22947 D EVENT : handleCapturedEvent: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=1412.0, y[0]=142.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x2000000, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196447, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=118229442 } orientation 0.0 screen 1 08-01 00:39:10.082 22947 22947 D EVENT : handleTouchEvent: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=1412.0, y[0]=142.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x2000000, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196447, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=118229442 } orientation 0.0 screen 1 08-01 00:39:10.083 22947 22947 D EVENT : handleCapturedEvent: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=1412.0, y[0]=142.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196452, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=571377011 } orientation 0.0 screen 1 08-01 00:39:10.083 22947 22947 D EVENT : handleTouchEvent: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=1412.0, y[0]=142.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=395196452, downTime=395196434, deviceId=132, source=0x100008, displayId=-1, eventId=571377011 } orientation 0.0 screen 1 ```
twaik commented 1 year ago

Ok. Another try. app-arm64-v8a-debug.zip

twaik commented 1 year ago

In this build coordinates should be fine or inverted (180°). Tell me what exactly happens.

hansm629 commented 1 year ago

In this build coordinates should be fine or inverted (180°). Tell me what exactly happens.

The same symptoms. T_T

The exact symptom is that with the X server called, the axis does not reverse and works well Symptoms of an inverted axis when the touchpad on the keyboard cover is clicked

twaik commented 1 year ago

Ok. Next try. apk

twaik commented 1 year ago

The exact symptom is that with the X server called, the axis does not reverse and works well Symptoms of an inverted axis when the touchpad on the keyboard cover is clicked

When Activity starts cursor is not yet captured. That is some Android security feature. You must click with mouse or touchpad to start capturing.

hansm629 commented 1 year ago

The exact symptom is that with the X server called, the axis does not reverse and works well Symptoms of an inverted axis when the touchpad on the keyboard cover is clicked

When Activity starts cursor is not yet captured. That is some Android security feature. You must click with mouse or touchpad to start capturing.

Oh! Gestures on the keyboard cover touchpad work in this version of APK!

However, there are still symptoms of an inverted axis.

And the symptoms of letterbox at the bottom of the screen were also confirmed.

Screenshot_20230802_091357_TermuxX11

twaik commented 1 year ago

I need you to post logs and video again. Wdym letterbox?

hansm629 commented 1 year ago

I need you to post logs and video again. Wdym letterbox?

I'm at work right now, so I'll post a log and video after work :)

twaik commented 1 year ago

Ok.

hansm629 commented 1 year ago

Ok.

Additional tests are the results.

There is a 'letterbox' at the bottom of the APK you built the latest.

https://github.com/termux/termux-x11/assets/101167173/c874d3b0-f6ec-4a30-852b-c85f68934c4e

The resolution setting is custom 1920X1200 Originally, shouldn't have a 'letterbox'.

Touchpad axis inversion test. I checked again and found that the X-axis works well without reversal.

but, the Y-axis is inverted to operate. In addition, only two touchpad gestures are working: one tap and drag.

https://github.com/termux/termux-x11/assets/101167173/457e1be9-bc53-4f11-91e7-01ab6e74c178

And the touchpad sensitivity is very sensitive compared to Android, so even if you move a little, the mouse pointer moves quickly and the drag works.

[Issue list] **1. 'Letterbox' at the bottom of the Termux-x11 screen

  1. Touchpad X-axis works fine but Y-axis inverted
  2. Touchpad gestures are operated only by one tap and drag, and other gestures such as double tap are not operated
  3. Touchpad works too sensitively on Termux-X11 (moves mouse pointer fast and unintended drag works)**

log.txt

Log file. Please check. Thank you :)

twaik commented 1 year ago

Next try. app-arm64-v8a-debug.zip I did not find any MotionEvent mentioning in the log. Did you collect the log while trying to use captured events?

About sensivity. You can manage it in DE's settings. It looks this like for XFCE. image But I have no idea what DE you are using.

twaik commented 1 year ago

About the letterbox. Curently I have no idea what causes it's appearing and how to fix it.

twaik commented 1 year ago

Is your tablet Dex enabled? I mean do you use Dex UI on tablet itself?

hansm629 commented 1 year ago

Is your tablet Dex enabled? I mean do you use Dex UI on tablet itself?

Used in a non-DeX mode.

First of all, I will test it again with the APK you delivered recently and give you feedback.

hansm629 commented 1 year ago

Is your tablet Dex enabled? I mean do you use Dex UI on tablet itself?

log2.txt

Symptoms are the same. I am sending you the log part again.

Letterbox is There are no symptoms in the apk under formal deployment. T_T

The symptoms are starting from the APK that you build today

twaik commented 1 year ago

Next try. app-arm64-v8a-debug.zip

hansm629 commented 1 year ago

Next try. app-arm64-v8a-debug.zip

That's great! In this version of APK, there is no touchpad axis warping!! This seems to have been fixed!

But

**1. One tap is too sensitive (dregs occur even if you move the touchpad slightly)

  1. When the touchpad is released during drag, mouse pointer position pop up
  2. When you click the touchpad while the mouse pointer is moving, the mouse pointer position pop up
  3. Letterbox Symptoms Occurred**

Does double tap recognition adjust in the mouse and touchpad settings of XFCE4 Improved, but still a slight movement of the touchpad will activate the drag.

This was the same when XFCE4 set sensitivity and acceleration. log3.txt

hansm629 commented 1 year ago

Next try. app-arm64-v8a-debug.zip

https://github.com/termux/termux-x11/assets/101167173/277ec214-88ba-4dbc-8c0c-97728e9dc27c

Letterbox symptom. I captured it on screen.

Both normal mode and DeX mode are the same.

When the Stretch to fit display toggle switch is turned off It looks like this Screenshot_20230803_012209_TermuxX11

twaik commented 1 year ago
  1. One tap is too sensitive (dregs occur even if you move the touchpad slightly)
  2. When the touchpad is released during drag, mouse pointer position pop up
  3. When you click the touchpad while the mouse pointer is moving, the mouse pointer position pop up

For some reason touchpad in capture mode is recognised as touchscreen so it uses the same algorythms. For some reason both this (your) and Dex mode touchpads behaviour is weird and device-specific. I can not fix it.

  1. Letterbox Symptoms Occurred

I found the root of the problem and will fix it in the next build.

hansm629 commented 1 year ago

Good job!

twaik commented 1 year ago
  1. One tap is too sensitive (dregs occur even if you move the touchpad slightly)

That should be fixed by b7937aed16b0e64fa7d4b54fd28c8bd81b99be9c .

cemalct commented 1 year ago

Sorry for bumping this, but I'm having the same issue, the latest APK you shared is fixing the issue but when I click or touch (for clicking) cursor stucks in there (it's clicking tho) then I need to press ESC to be able to move it again. (I can click while cursor is stucked) Galaxy Tab S8+ - Galaxy Book Cover

twaik commented 1 year ago

Are you using "simulated touchscreen" mode?

twaik commented 1 year ago

@rssvxoxo

cemalct commented 1 year ago

So sorry, forgot to response. It seems the issue is related with Box64droid, after installing linux; the issue has been solved, but the first issue is (sensitive trackpad) kinda annoying. Mind possible we get the fixed version?

twaik commented 1 year ago

A bit later. I am working on touchpad compatibility.

markinhosmrk commented 11 months ago

Hi team! I understand this is in progress, just wanted to report that I have the same issue (Galaxy Tab S8 Ultra and Book cover). Tried the debug apk and it works but two finger actions still had their axes reversed. And in general felt very sensitive. It also seemed to "lock" the trackpad to the app, could not use it when switched to other apps. It was released after locking the screen only.

AlphaBs commented 11 months ago

@twaik

I'm using Samsung Galaxy Tab S8+ bookcover keyboard, the same model. The issue still occurs in the latest nightly build (https://github.com/termux/termux-x11/commit/84901c2f1c3761b49477d798efd051daf92be3b8).

x11.log

I can provide more information if you need.

twaik commented 11 months ago

Unfortunately I can not fix it until I have one device for tests.

cemalct commented 11 months ago

Guys, I can assure you there will always be a problem if you want to run it as linux device or alternative to writing codes. I realised nothing would provide a laptop-wise experience while using Galaxy Tab S8. Sold it, and switched to Macbook Air M2. The only issue I'm having is screen 60hz, but it's not a big deal. I recommend you to switch Macbook instead of wasting time to Galaxy Tab S8. I know, Tab S8 is the perfect device but with the worst OS, yet OS matters a lot, so lower your expectation and switch to Macbook.

Nick768 commented 7 months ago

I am having the same problem with my Lenovo Tab P12 and it's keyboard cover... It is usable, but it feels like 4 times too fast for me. I am using the version based on f71baf2. My "Touchscreen input mode" setting is set to "Simulated touchscreen". Everything else works (except I cannot copy text from my androids clipboard to an opened window, but the other way around works). I already tried setting the minimum speed in xfce and disabling every other mouse device in the settings, but it doesn't change anything.

jabcross commented 6 months ago

I'm getting the reversed axis problem on my Galaxy Tab 7 FE. All of the gestures seem to work, the only problem is the movement direction. Is there a way around this? (Using capture mouse mode).

I found a generic solution online that uses xinput, but I don't know how to install this in termux.

twaik commented 5 months ago

All of the gestures seem to work, the only problem is the movement direction. Is there a way around this?

It is usable, but it feels like 4 times too fast for me.

Check the build 594. It has preferences "Transform captured pointer movements" and "Captured pointer speed factor" so you can adjust this.