magic4pc icon indicating copy to clipboard operation
magic4pc copied to clipboard

Support for more mouse inputs

Open mafredri opened this issue 2 years ago • 3 comments

Hi,

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

  • [ ] Mouse click (click)
  • [ ] Touch (touchmove, touchstart, touchend, touchcancel?)
  • ~~Scroll (scroll)~~
  • [ ] Scroll wheel (wheel)

We can easily add click and touch via event listeners.

Touch is relevant for two use-cases:

  • If the remote moves slightly when pressing down the button (scroll wheel) it may result in click becoming touchmove
  • Performing actual touch-based "scrolling" (on the client side, these can be translated into vertical/horizontal scroll events or possibly even emulating touch)

~~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.)

mafredri avatar Jan 30 '22 20:01 mafredri