XITRIX / Moonlight-Switch

Moonlight port for Nintendo Switch
907 stars 49 forks source link

Touch emulate as moonlight-nx #83

Closed maytinhdibo closed 7 months ago

maytinhdibo commented 1 year ago

In Moonlight-NX, we can use the touch screen on Switch as touchscreen on Windows. With it, we will use touch screen con Citra on PC. image

XITRIX commented 1 year ago

Hmm, nice point, I'll try to figure it out

Skyyblaze commented 1 year ago

Sorry to bug but is this still being looked into? I had both Moonlight NX and Moonlight Switch on my system for exactly this reason as I found Switch generally be better but NX was useful for the touch-screen feature. As of the latest Nvidia GameReady driver NX stopped working though :(

XITRIX commented 1 year ago

Hi, I'm not actively maintain current version of Moonlight-Switch, cause I'm creating my own UI framework at this moment. I think when I'm done I'll rewrite entire Moonlight-Switch from scratch, so I don't want to spend extra time to the stuff I'll rewrite anyway. If I'll have some spare time, I'll try to implement this, but I could not promise it, sorry.

XITRIX commented 1 year ago

Ok, nevermind, I've found some time to implement this. I did not tested it too much, but seems like it's working.

@Skyyblaze, check out this build and say if works fine or it need some tuning.

Skyyblaze commented 1 year ago

Thank you so much, also for your future work! I'm waiting for the build to finish and will then report back :)

Skyyblaze commented 1 year ago

@XITRIX Hmm it seems to work semi-correctly. It does partially work like it should but the mouse-position seems to be relative to where the mouse currently is on the screen instead of being absolutely where I touch which leads to lots of weird inputs :(

XITRIX commented 1 year ago

Ok, I'll try to check what's going wrong, I think I messed up with an order of mouse position change and button click

Skyyblaze commented 1 year ago

Ok, I'll try to check what's going wrong, I think I messed up with an order of mouse position change and button click

Thank you! Tag me when you have a new build, I'll gladly test again :)

EzWiz21 commented 1 year ago

Native touch support is available on Sunshine nightly. It’ll be better to use that rather than emulating it with the mouse.

XITRIX commented 1 year ago

@renA21, it should be supported by moonlight-core first to make it possible to implement in Moonlight-Switch

EzWiz21 commented 1 year ago

It’s available in core since https://github.com/moonlight-stream/moonlight-common-c/commit/4a48024dc825a19a3c5d27ca53dbd025b93ead45

GrayXu commented 9 months ago

this feature will be very useful in many touch-based games, thank you for your contribution!

XITRIX commented 7 months ago

Implemented in v1.0