diff --git a/.eslintrc b/.eslintrc index 563e9e4..997fe47 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,6 +5,7 @@ }, "env": { + "browser": true, "es6": true, "node": true } diff --git a/README.md b/README.md index ac5787d..0aca0ed 100644 --- a/README.md +++ b/README.md @@ -2,31 +2,31 @@ **A global utility for tracking the current input method (mouse, keyboard or touch).** -## What Input is now v5 +## _What Input_ is now v5 Now with more information and less opinion! -What Input adds data attributes to the `window` based on the type of input being used. It also exposes a simple API that can be used for scripting interactions. +_What Input_ adds data attributes to the `window` based on the type of input being used. It also exposes a simple API that can be used for scripting interactions. ## How it works -What Input uses event bubbling on the `window` to watch for mouse, keyboard and touch events (via `mousedown`, `keydown` and `touchstart`). It then sets or updates a `data-whatinput` attribute. +_What Input_ uses event bubbling on the `window` to watch for mouse, keyboard and touch events (via `mousedown`, `keydown` and `touchstart`). It then sets or updates a `data-whatinput` attribute. Pointer Events are supported but note that `pen` inputs are remapped to `touch`. -What Input also exposes a tiny API that allows the developer to ask for the current input, set custom ignore keys, and set and remove custom callback functions. +_What Input_ also exposes a tiny API that allows the developer to ask for the current input, set custom ignore keys, and set and remove custom callback functions. _What Input does not make assumptions about the input environment before the page is interacted with._ However, the `mousemove` and `pointermove` events are used to set a `data-whatintent="mouse"` attribute to indicate that a mouse is being used _indirectly_. ## Demo -Check out the demo to see What Input in action. +Check out the demo to see _What Input_ in action. https://ten1seven.github.io/what-input ### Interacting with Forms -Since interacting with a form _always_ requires use of the keyboard, What Input uses the `data-whatintent` attribute to display a "buffered" version of input events while form ``s, `