Wouterdek / magic4pc

Allows you to use the magic remote on your LG tv as a mouse for your PC.
MIT License
72 stars 7 forks source link

Support for more mouse inputs #7

Open mafredri opened 2 years ago

mafredri commented 2 years ago

Hi,

I was building a m4p client for Linux (written in Go) and noticed the following events are missing:

We can easily add click and touch via event listeners.

Touch is relevant for two use-cases:

Scroll is a bit harder because, unless I'm mistaken, we'd need a UI element that is scrollable in the foreground to trigger scroll events in the browser. Currently the overlay (div) that contains the settings button is the top-most element, scrolling events would be directed towards it (if it was scrollable). A scrollable element would have to either be above it (z-index) or inside it.

Another option would be to look for lower level (hardware) inputs from the magic remote and get button presses and/or scroll events from there.

Do these features sound like a good fit for magic4pc? (I can submit some PRs once I have something working.)

Wouterdek commented 2 years ago

Cool! I'm definitely interested in a PR when you have one.

Informatic commented 2 years ago

wheel event is the event you are looking for for scrollwheel capture. wheel

mafredri commented 2 years ago

@Informatic not sure how I missed that, that's exactly what I wanted to find 😄. Thanks for the tip!