-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Forward mouse move without button pressed to device #3070
Comments
But the mouse is not visible on the device, right? (contrary to |
Correct. I haven't used the HID mouse emulation mode, I know Android will display its own mouse cursor, but do you capture the mouse and hide the cursor on computer? Otherwise there will be two cursors? In my method injecting hover move, the mouse is still in absolute mode, so hover state on Android Apps is always under the computer mouse cursor, and Android won't display its own cursor. |
Yes.
OK, I will try, and maybe enable it or add an option. |
just like shooting games if we could do the mouse move like appPower mirror. Also please let us know how to donate to your project |
I made a quick test: diff --git a/app/src/mouse_inject.c b/app/src/mouse_inject.c
index 2e89de9a..1d5a975b 100644
--- a/app/src/mouse_inject.c
+++ b/app/src/mouse_inject.c
@@ -58,17 +58,13 @@ convert_touch_action(enum sc_touch_action action) {
static void
sc_mouse_processor_process_mouse_motion(struct sc_mouse_processor *mp,
const struct sc_mouse_motion_event *event) {
- if (!event->buttons_state) {
- // Do not send motion events when no click is pressed
- return;
- }
-
struct sc_mouse_inject *mi = DOWNCAST(mp);
struct sc_control_msg msg = {
.type = SC_CONTROL_MSG_TYPE_INJECT_TOUCH_EVENT,
.inject_touch_event = {
- .action = AMOTION_EVENT_ACTION_MOVE,
+ .action = event->buttons_state ? AMOTION_EVENT_ACTION_MOVE
+ : AMOTION_EVENT_ACTION_HOVER_MOVE,
.pointer_id = POINTER_ID_MOUSE,
.position = event->position,
.pressure = 1.f, On a Nexus 5, it has no effect. Maybe some ACTION_HOVER_ENTER and ACTION_HOVER_EXIT are necessary?
How does APowerMirror send mouse event? (I've never used it) |
i think they use the swap and merge it with mouse move. like key mapping along with mouse mapping |
Yes, the ultimate outcome is decided by each App.
I didn't try them. I found |
Samsung S Pen supports hovering, so Samsung One UI might be the best system in supporting hover state. I did more tests around One thing I found is that when another pointer is DOWN, the hovering pointer must be removed, otherwise the new pointer won't do anything. With a real OTG mouse, touching the screen with finger will automatically deactivate the mouse. |
Any news about this? On Android Studio, it's implemented right now, so when you hover with your mouse over (probably almost and not all) anything , it makes an effect for it accordingly. |
I just re-tested this patch: #3070 (comment) It seems to work on my Pixel 8. Could you please test? If that works, we can add an option, either:
(other suggestions for naming are welcome) |
@rom1v I can test on Pixel 6 with Android 14 and Honor Magic 4 pro with Android 14. |
@AndroidDeveloperLB Here is a binary with the patch above:
|
@rom1v Thank you. Now I wonder if you will make it the default behavior or not, and if it has any danger in using it... |
Implemented by #5039. |
@rom1v Thank you! |
Also add an option --no-mouse-hover to get the old behavior. Fixes Genymobile#2743 <Genymobile#2743> Fixes Genymobile#3070 <Genymobile#3070> PR Genymobile#5039 <Genymobile#5039>
Also add an option --no-mouse-hover to get the old behavior. Fixes Genymobile#2743 <Genymobile#2743> Fixes Genymobile#3070 <Genymobile#3070> PR Genymobile#5039 <Genymobile#5039>
Recently I'm implementing
--forward-all-clicks
option for my client, and I tried to useACTION_HOVER_MOVE
action for mouse movement events without button pressed. I was surprised that many Apps will react to itRelated code: https://github.com/yume-chan/ya-webadb/blob/36d44243cc1b40dcaa83c77b0b423add5202c8f7/apps/demo/pages/scrcpy.tsx#L676-L681
(Google Chrome)
(Samsung One UI Settings)
(Google Play Store)
(Twitter, notice second bottom bar button)
It's not very useful, and I'm not actually requesting you to implement it. Just want to let you know it's possible.
The text was updated successfully, but these errors were encountered: