Arian04 / android-hid-client

Android app that allows you to use your phone as a keyboard and mouse WITHOUT any software on the other end (Requires root)
GNU General Public License v3.0
109 stars 4 forks source link

Add a loopback mode to use phone screen as trackpad for attached second screen #42

Open daniellandau opened 1 month ago

daniellandau commented 1 month ago

It would be great if the code in this app could be easily extended to not send mouse movements out from the USB, but instead register to the local Android system as a connected emulated external mouse and that way the primary phone display could be used as a trackpad for an attached external display. When there's an external display, a USB mouse automatically shows a cursor only on the external display (when using Force Desktop mode from developer settings), but for example KDE Connect mouse receiver only shows a cursor on the primary phone display.

Arian04 commented 1 month ago

interesting use case! so just to confirm, when you connect a USB mouse to the phone, you're able to simultaneously use the mouse on the external display and your fingers on the touchscreen of the phone itself?

daniellandau commented 1 month ago

Yes, although it seems to be dependent on the order of plugging the display and the mouse in. Sometimes it goes to a state where the mouse cursor is also stuck on the phone screen. This is on Android 14 crDroid.

Arian04 commented 1 month ago

interesting!! thanks for the info, I'll look into this soon. slowly getting back into working on this after being busy

Arian04 commented 1 month ago

Could you attempt to use adb as described here to send inputs like you want to?

If it's not too much trouble, could you also check if /dev/uhid is present on your system?

Just looking into which implementations of this are possible/most convenient right now. Thanks!

gaussandhisgun commented 3 weeks ago

fyi: this can be tested without a physical external display if you enable both Force Desktop Mode (android 10+) and Emulate External Displays settings in Developer Settings on your phone

Arian04 commented 3 weeks ago

thanks! I actually looked for that earlier but ig somehow missed it, because I found it right now. might've not noticed a typo when I searched + just not seen it when I scrolled through settings.