Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for more mouse inputs #7

Open
3 tasks
mafredri opened this issue Jan 30, 2022 · 3 comments
Open
3 tasks

Support for more mouse inputs #7

mafredri opened this issue Jan 30, 2022 · 3 comments

Comments

@mafredri
Copy link
Contributor

mafredri commented Jan 30, 2022

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

@Wouterdek
Copy link
Owner

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

@Informatic
Copy link
Contributor

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

@mafredri
Copy link
Contributor Author

mafredri commented Feb 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants