ten1seven / what-input

A global utility for tracking the current input method (mouse/pointer, keyboard or touch).
https://ten1seven.github.io/what-input
MIT License
1.35k stars 89 forks source link

Mouse wheel doesn't trigger any changes #95

Closed matteobad closed 5 years ago

matteobad commented 5 years ago

Mouse wheel doesn't trigger any changes.

I would expect the mouse wheel to trigger a change. But when scrolling the wheel no changes occurs. I'm not entirely sure, but I think that a wheel event should be treated similarly to a mouse/pointer move event. Let me know what you think about this. Thanks in advance and keep up the great work.

Step to reproduce:

  1. Open the demo
  2. Start navigating with keyboard
  3. Use the mouse wheel without moving the pointer
  4. No changes in what-input or what-intent

Expected behavior:

ten1seven commented 5 years ago

Hi @matteobad,

There actually is mousewheel support built in, but it appears that it's not functioning as it should so I'm going to take a look at it.

https://github.com/ten1seven/what-input/blob/master/src/scripts/what-input.js#L318-L334

ten1seven commented 5 years ago

I made an update in the latest release (v5.2.3) that addresses mousewheel not always being detected. Please note that wheel, mousewheel, and DOMMouseScroll all report as mouse.

If you have any issues, please re-open this ticket.

matteobad commented 5 years ago

Thank you for your rapid response 👍