ngl icon indicating copy to clipboard operation
ngl copied to clipboard

Support pointer events instead of just mouse/touch events

Open luxaritas opened this issue 2 years ago • 2 comments

I've noticed that currently, input listeners are registered specifically for mouse and touch events. Depending on what your preference for browser support is, it's relatively well supported and generally easier to work with than mouse + touch, and is generally more futureproof (eg, handling additional types of input devices).

luxaritas avatar Jan 19 '22 01:01 luxaritas

Looks interesting - is there some particular issue this would fix, or functionality it would add? (I don't often use NGL with a touchscreen so can't comment with any great experience on this)

fredludlow avatar Apr 13 '22 09:04 fredludlow

There aren't any significant/obvious benefits, but there's three potential points of rationale I'd consider:

  1. Specifically in my case, I'm embedding NGL in another app and have to propagate input. We typically only deal with pointer events, so this would simplify our interop code.
  2. The Pointer event API is much more convenient, so using it instead of mouse/touch events is liable to improve NGL's code (unifying mouse and touch handling and generally being a bit cleaner).
  3. It's more futureproof against new types of input devices

luxaritas avatar Apr 13 '22 15:04 luxaritas