-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mouse click not working on window minimize & maximize & close on Android 14 #203
Comments
Please try enabling click-delay in AVNC:
|
I were tried this,no lucky yet |
Which VNC server & operating system are you using? |
OS:
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
VERSION_ID="2023.4"
VERSION="2023.4"
VERSION_CODENAME=kali-rolling
ID=kali
ID_LIKE=debian
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"
ANSI_COLOR="1;31"
kail from https://www.kali.org/docs/nethunter/nethunter-rootless/ yes,it works before upgrade. |
That's really weird. I don't have an Android 14 device, but when I get some time I will try to setup an emulator to see if the issue can be reproduced there. Meanwhile, please help me pinpoint the exact scenario where this bug happens.
|
1.touch_test_log.txt I use mouse to operate,select text is fine,while left click not working,I turn offed the mouse pass through,the mouse click on those icons works,but still has some wired behaviors,when I right click on desktop,it seems couldn't distinguish left click and right click. I think it's some kind of events been false interpreted,I googled and found this.https://www.xda-developers.com/surface-pro-9-1000-deal/ it says some keycodes mapping changed.does this help? after some tests,I presumed that click also recognized as touch gesture,since I change gesture setting double tap to left click,then right click twice on desktop same as left clicked. |
These logs indicate that you are using your finger to click on touch screen when testing. If you really used the mouse for this test, than that might explain the issue you are facing. Otherwise please test with the same mouse you use for VNC session.
Yes, when you disable mouse passthrough, AVNC cannot differentiate between left and right mouse button. You need to long-press with either button to trigger right click on server.
Yes. |
thought you were asking testing with fingers,here is log that simulating till swipe,all using mouse left button. |
Thanks. Looking at these logs, mouse click should work correctly. Let me investigate a bit more. |
here is video,it's something wrong if mouse over the right half screen,maybe some coordinates or screen width miscalculated,I am using desktop mode,something similar to a virtual secondary screen, all actions using mouse left button. 2024-01-26.09-37-08.mp4 |
Thanks for the video @SuJiKiNen, that's really helpful. I am attaching a debug APK here: app-debug.zip
Now go to Settings => Tools => Logs. Copy the logs, and pate here. |
thanks for your quick response,here your are. |
I think you missed the file upload |
sorry,I re-uploaded. |
Sorry, for some reason your device is filtering the logs (some device do this). Hence logs added by AVNC are not available in the output. Please use this APK to run the test I mention above and re-upload the logs. It will keep the logs in app memory without going through Android: app-debug.zip Full logs might be also be available through ADB, so let me know if you have a computer to run ADB. |
sorry for the late reply,I been busy on weekend,here is the log.hope this helps. |
No problem at all :) Going through the logs, its looks like an issue with your Android version itself. Lets see two snippets of logs: When clicking at point [3630, 97], not working: 23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.onTouchEvent(TouchHandler.kt:47): MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868126, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=884513322 }
23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.handleStylusEvent(TouchHandler.kt:127): MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868126, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=884513322 }
23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.handleMouseEvent(TouchHandler.kt:88): passthrough: true, e: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868126, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=884513322 }
23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.onTouchEvent(TouchHandler.kt:47): MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868279, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=809558004 }
23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.handleStylusEvent(TouchHandler.kt:127): MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868279, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=809558004 }
23:13:54: com.gaurav.avnc.ui.vnc.TouchHandler.handleMouseEvent(TouchHandler.kt:88): passthrough: true, e: MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=3630.0, y[0]=97.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142868279, downTime=142868126, deviceId=56, source=0x3002, displayId=15, eventId=809558004 } When clicking at point [1611, 568], working as expected: 23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.onTouchEvent(TouchHandler.kt:47): MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x3002, displayId=15, eventId=428762296 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.handleStylusEvent(TouchHandler.kt:127): MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x3002, displayId=15, eventId=428762296 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.handleMouseEvent(TouchHandler.kt:88): passthrough: true, e: MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x3002, displayId=15, eventId=428762296 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.onGenericMotionEvent(TouchHandler.kt:54): MotionEvent { action=ACTION_BUTTON_PRESS, actionButton=BUTTON_PRIMARY, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x2002, displayId=15, eventId=486625487 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.onHoverEvent(TouchHandler.kt:59): MotionEvent { action=ACTION_BUTTON_PRESS, actionButton=BUTTON_PRIMARY, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x2002, displayId=15, eventId=486625487 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.handleStylusEvent(TouchHandler.kt:127): MotionEvent { action=ACTION_BUTTON_PRESS, actionButton=BUTTON_PRIMARY, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x2002, displayId=15, eventId=486625487 }
23:14:25: com.gaurav.avnc.ui.vnc.TouchHandler.handleMouseEvent(TouchHandler.kt:88): passthrough: true, e: MotionEvent { action=ACTION_BUTTON_PRESS, actionButton=BUTTON_PRIMARY, id[0]=0, x[0]=1611.0, y[0]=568.0, toolType[0]=TOOL_TYPE_MOUSE, buttonState=BUTTON_PRIMARY, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=142898595, downTime=142898595, deviceId=56, source=0x2002, displayId=15, eventId=486625487 }
23:14:25: com.gaurav.avnc.ui.vnc.Dispatcher$AbstractMode.doButtonDown(Dispatcher.kt:193): button: Left, p:PointF(1611.0, 568.0)
23:14:25: com.gaurav.avnc.vnc.Messenger.sendPointerButtonDown(Messenger.kt:60): button: Left, p:PointF(788.3334, 315.55557), pointerButtonMask:0
23:14:25: com.gaurav.avnc.vnc.VncClient.sendPointerEvent(VncClient.kt:171): Sending pointer event: 1 at [788 , 315] Android reports full-fledged mouse events via Because MultiVNC is also affected, and this only started happening after Android update, I think AVNC might not be the issue here. To confirm this theory, we need to test other apps. If you have any other app which uses mouse right click differently (e.g. right click opens a menu), you can test to see if it has the same issue in different halves of the screen. One such app might be the web browser. |
I tested some office document apps,works fine. after some debug testing,click on right half screen, AVNC only receives gesture events. |
Well, that's a bummer 😕.
I will let you know if/when I find something. In the meantime, you can disable mouse pass through. |
I have full dev setup now,but don't know where to start |
That's odd. In my #203 (comment) above, you can see that the first click happens at coordinate
That great! How comfortable are you with Android Studio, or IDEs in general? |
that's another pc . I used Android Studio twice before,a lot of things need to learn. |
I have a feeling this is the root cause, but lets wait and see.
Primary point of interest in AVNC is the TouchHandler class. This is where all MotionEvents are received by three functions: But first, lets start with something simple. We can test MotionEvent delivery with a brand new project in Android Studio. This will be easier to start for you, and it will rule out any bug in AVNC. I am using Android Studio HedgeHog 2023.1.1. Follow these steps:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:id="@+id/root">
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
/*Add event listeners*/
val root = findViewById<View>(R.id.root)
root.setOnTouchListener { _, event ->
Log.d("EventTest", "TouchEvent: $event")
true
}
root.setOnGenericMotionListener { _, event ->
Log.d("EventTest", "GenericEvent: $event")
true
}
/* Hover generates a lot of events. Uncomment this to log all mouse movements
root.setOnHoverListener { _, event ->
Log.d("EventTest", "HoverEvent: $event")
true
}*/
}
}
You can open the Logcat window to see logged events, or you can set breakpoints on listeners and debug the app. Our primary interest is the |
Thank you very very very much.
how do you think? |
I found this is not able to tell which button been released. |
That's the main reason. But if you look through the issues in this repo, you will find many issues involving touch input. Many devive manufacturers mess with stock Android behaviour, so current implementation in AVNC has seen many revisions, and handles a lot of wierd devices. Best choice here is to report this issue to Motorola and get the root cause fixed by them, instead of finding a workaround which might break with the next upgrade. |
yes,that's best what we can do.IMO,android itself also a bit messy. |
Yeah, in some areas, developing for Android is just too messy. What's more frustrating is that I, as a developer, have no way to reproduce such bugs. Every manufacturer mess with stock behavior, and these ROM's only run on specific devices. Anyway, I am closing this bug. Hopefully Motorola listens to your feedback. |
click on some window's minimize, & maximize & close not working,and some other buttons.
not sure if this problem is device specific,I have updated my Motorola x40 system to android 14 recently,I used termux proot
I tested avnc and multi-vnc both not working,only got lucky on realvnc。
if anyone encounter this, we can discuss details further.
The text was updated successfully, but these errors were encountered: