Author Topic: Could Moonlight Streaming for Vita be modified with absolute touch-screen input?  (Read 578 times)

Offline Skyy

  • End User
  • *
  • Posts: 4
    • View Profile
Hi I registered here to ask a question because this seems to be the place where the most talented Vita developers are.

Now I'm by no means a developer myself and nowadays I mostly use my Vita as a Remote Play device for my PC and PS4. Moonlight works great for that but there would be one thing that would enhance Moonlight a ton, right now the touch-screen of the Vita acts as a trackpad in Moonlight and I wondered, would it be at all possible to have the touch-screen act as an absolute mouse-input area instead? So if I press an area on the touch-screen it will do a left-click on the area where pressed?

I use an Android emulator on my PC to play quite a few mobile games on my Vita via streaming and since the UI's of the games are obviously touch-screen centric having to drag the mouse around via a screen trackpad is less than ideal.

Would that be something that could be done and anybody here would be willing to tackle?

Offline dots_tb

  • Refugee
  • **
  • Posts: 93
    • View Profile
Hi, welcome to the CBPS forums, hope you enjoy:

I looked at the moonlight source:

https://github.com/xyzz/vita-moonlight/blob/vita/src/input/vita.c#L399
So this would be the area that mouse states are handled and I am guessing that two fingers is scroll, a quick tap is click, and as you said moving is handled relatively.

The function that controls mouse movement can be seen here:

https://github.com/xyzz/vita-moonlight/blob/vita/src/input/vita.c#L105

It looks like the delta is calculated between the new and old points to modify the mouse position creating the relative movement you see.

In theory, I'm guessing this could be modified to be an absolute mouse-input area as you are requesting with some sort of scaling to account for any aspect ratio or resolution changes.

However, I don't have a PC capable of testing moonlight stuff.

Hope this helps though kek.

Offline Skyy

  • End User
  • *
  • Posts: 4
    • View Profile
Hi, welcome to the CBPS forums, hope you enjoy:

I looked at the moonlight source:

https://github.com/xyzz/vita-moonlight/blob/vita/src/input/vita.c#L399
So this would be the area that mouse states are handled and I am guessing that two fingers is scroll, a quick tap is click, and as you said moving is handled relatively.

The function that controls mouse movement can be seen here:

https://github.com/xyzz/vita-moonlight/blob/vita/src/input/vita.c#L105

It looks like the delta is calculated between the new and old points to modify the mouse position creating the relative movement you see.

In theory, I'm guessing this could be modified to be an absolute mouse-input area as you are requesting with some sort of scaling to account for any aspect ratio or resolution changes.

However, I don't have a PC capable of testing moonlight stuff.

Hope this helps though kek.


Thanks for the welcome!

Well as said I'm nowhere near a developer so while this sounds promising this in itself sadly doesn't help me :P But if anyone would like to do it I would be more than happy to do all the testing, give feedback, gather log-files and so on.