gujjwal00 / avnc

VNC Client for Android
GNU General Public License v3.0
679 stars 60 forks source link

Two-finger scrolling not working with Samsung trackpad (keyboard cover) #31

Closed gujjwal00 closed 2 years ago

gujjwal00 commented 2 years ago

Greetings @gujjwal00 . Once again, thank you very much for your commitment to the community. I did the test with the samsung trackpad (keyboard cover). Single click and double click working perfectly. The movement too.

Mistake I cannot scroll to move up or down a content.

What happens? When you try to scroll with two fingers on the trackpad, what happens is a navigation through the elements of the screen without the pointer moving.

https://user-images.githubusercontent.com/51301335/147293565-f4bed359-868f-4a05-baae-055cb2cf8549.mp4

Originally posted by @zequinh4 in https://github.com/gujjwal00/avnc/issues/5#issuecomment-1000534505

gujjwal00 commented 2 years ago

I am attaching a test app here which can record touch events received from Android. Can you please run this, perform some gestures with touchpad, and post the logs here?

touch-tester.zip

zequinh4 commented 2 years ago

Hi @gujjwal00 . Hope I managed to do it the right way hihihi. Merry Christmas and thank you again!

Logs.txt

zequinh4 commented 2 years ago

@gujjwal00 Another test.

Logs2.txt

gujjwal00 commented 2 years ago

Thanks for the logs @zequinh4 , and Merry Christmas to you too 🎅.

I have some questions:

zequinh4 commented 2 years ago

Hello again my friend @gujjwal00 :santa:

  • Quais ações você configurou para 1 Finger Swipe& 2 Finger Swipegestos nas configurações? Yes, I set it up like the image below.
  • Você habilitou a Hide Remote Cursoropção do servidor? Yes, I hid the cursor because there is always a delay.
  • Você está usando o APK que postei no modo [Adicionar Mouse Trackpad e gesticular como o laptop ] I'm using this apk (app-test.zip) that you made available! --> (https://github.com/gujjwal00/avnc/issues/5) nº 5 ?

Screenshot_20211224-134640_AVNC Screenshot_20211224-134654_AVNC Screenshot_20211224-135049_AVNC

gujjwal00 commented 2 years ago

Thank you.

So what's happening here is that 2-finger swipe is being treated as 1-finger swipe, to which you have assigned Move Pointer action. So the remote pointer is being moved, but as you have hidden it, its not visible.

Unfortunately, this is out of my control. If you look at the logs:

GestureStart: Swipe
...
OT: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=591.27625, y[0]=306.92072, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x10000002, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=368685017, downTime=368685017, deviceId=181, source=0x3002, displayId=0 }
OT: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=584.3911, y[0]=306.92072, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x10000002, edgeFlags=0x0, pointerCount=1, historySize=1, eventTime=368685033, downTime=368685017, deviceId=181, source=0x3002, displayId=0 }

GestureStart: 2-finger Scroll
...
OT: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=869.8763, y[0]=309.9757, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x10000002, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=368698215, downTime=368698215, deviceId=181, source=0x3002, displayId=0 }
OT: MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=869.99115, y[0]=293.48785, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x10000002, edgeFlags=0x0, pointerCount=1, historySize=2, eventTime=368698232, downTime=368698215, deviceId=181, source=0x3002, displayId=0 }

you will notice that both of these gestures are generating similar events, and pointerCount is 1 in both cases. Hence, AVNC is unable to differentiate between two gestures.

This is a known issue with how this device generates touchpad events, and if you read through #9 , you will notice some other issues.

If you want, you can set the action for '1-Finger Swipe' to Scroll Remote Content.

zequinh4 commented 2 years ago

@gujjwal00 Interestingly putting "1 finger swipe" as scroll and keeping "2 finger swipe" as scroll is working perfectly. The other functions are still working perfectly! Thank you my friend! I'm looking forward to releasing this update on F-Droid!

https://user-images.githubusercontent.com/51301335/147368493-59658d67-04b9-4b85-8c46-b95ab7bb3336.mp4

Screenshot_20211224-151620_AVNC

zequinh4 commented 2 years ago

@gujjwal00
I suggest the implementation of a switch in the "input" menu so that this configuration automatically occurs for the Samsung Bookcover Keyboard. Ex: "Samsung Bookcover Keyboard". It would easily solve this compatibility issue! Hugs!

gujjwal00 commented 2 years ago

You don't have to wait for F-Droid update. Current version there already supports setting scroll on 1-finger swipe.

Automatic setting change via hardware detection is out of scope, for now at least.