Skip to content

concept: support external displays created by Android desktop mode#127

Closed
axonasif wants to merge 2 commits intoXtr126:devfrom
axonasif:axonasif/external_display
Closed

concept: support external displays created by Android desktop mode#127
axonasif wants to merge 2 commits intoXtr126:devfrom
axonasif:axonasif/external_display

Conversation

@axonasif
Copy link
Copy Markdown

The code is just for checking if it's possible, not for using. Most of the java code was AI generated, I think we would need an profile option to specify the desired display ID in XtMapper. If you're interested and have the time to properly implement this, I would really appreciate it!

I certainly don't know what I'm doing, so going to dump all the "research" I've done here in case that's any helpful.

How to get info about all the displays (including external ones)

# Just some commands you can use for inspecting, you may remove the grepping and all for verbose info
cmd display get-displays | grep "Display id"

dumpsys SurfaceFlinger display | grep -a 'parent=Display ' | uniq

# Also from srcpy:
scrcpy --list-displays -e # -e for wireless adb

How to test if you can simulate input on an external display

If you have a samsung device with display out, you can just enable dex and find the display ID. For other phones, you will need to enable "force desktop mode" in the developer settings. It also helps if you enable "pointer location" for testing where the input is going.

Once you have a list of display IDs (sometimes there can be extra virtual displays for input handling), you can test like so:

# Replace -d 0 with other IDs that you found, 0 is usually the main built-in display
input -d 0 swipe 100 200 500 200 3000

What's "working"

  • Mapping is possible on the external display (was already, just mentioning)
  • Mapped keyboard keys are properly injected in display 2 instead of the phone display.
  • Locking/toggling mouse crosshair focus, sensitivity/movement may be buggy or not properly tuned, can't confirm due to lack of proper mouse.

What's not working or needs work

  • XtMapper virtual Mouse cursor floats over the main display 0 instead of the desired display. But mouse inputs are being injected in the desired display. I don't have a proper mouse, only a trackpad so couldn't test much.

@axonasif axonasif changed the title concept: support external displays concept: support external displays created by Android desktop mode Mar 16, 2025
@hmtheboy154
Copy link
Copy Markdown

oh my god AXON making PoC

@axonasif
Copy link
Copy Markdown
Author

oh my god AXON making PoC

Lol. How's it going man

@hmtheboy154
Copy link
Copy Markdown

oh my god AXON making PoC

Lol. How's it going man

I'm doing great, thanks for asking

@Xtr126
Copy link
Copy Markdown
Owner

Xtr126 commented Mar 19, 2025

Now it shows the virtual cursor on a secondary display but need to fix the scaling
image

@axonasif
Copy link
Copy Markdown
Author

Now it shows the virtual cursor on a secondary display but need to fix the scaling
image

Amazing!

@Xtr126
Copy link
Copy Markdown
Owner

Xtr126 commented Apr 2, 2025

Closing since we now have external display input working at least on some devices/Android versions, it could be improved later on.
Thanks for the detailed concept and PoC, would not have started on implementing external display support without your findings.

@Xtr126 Xtr126 closed this Apr 2, 2025
@axonasif
Copy link
Copy Markdown
Author

axonasif commented Apr 2, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants