homeworkc / lazycast

A Simple Wireless Display Receiver
GNU General Public License v3.0
688 stars 89 forks source link

Sending touch input to host #114

Closed keesblok closed 1 year ago

keesblok commented 1 year ago

I am trying to send additional input events (touch screen events) from the Raspberry Pi to the host/source.

After looking at how the current events are handeled in d2.py, I would like to ask where I can find some documentation on what bytes to send to the host.

I know how to get the input from the touchscreen in python, just not what to send to the host.

So how do I know what to put in m7 to get specific events working?

Thanks in advance!

keesblok commented 1 year ago

After searching a bit more, I think I found it in the Miracast specification in the section "User Input Back Channel". If I have time and if can get it working, I might open a pull request to add the functionality to this repo

homeworkc commented 1 year ago

FYI, there are two methods of sending inputs. One is "Generic" the other is "HIDC". Some older commits actually implemented both but the latest commits only use HIDC. The HIDC protocol is exactly the same in the USB spec and the traffic you'll see in USB captures, except that a few bytes are prepended to the front. For custom HIDC, you'll need to first send the HID descriptor (basically part of the USB descriptor during a normal USB enumeration) and afterwards, send the HID inputs ("m7" in the codes, but the "m7" in the context does not actually mean anything and it's just a random variable name).