# What Input?
__A global utility for tracking the current input method (mouse, keyboard or touch).__
## What Input is now v4
What Input adds data attributes to the `` tag based on the type of input being used. It also exposes a simple API that can be used for scripting interactions.
### Changes from v3
* `mousemove` and `pointermove` events no longer affect the `data-whatinput` attribute.
* A new `data-whatintent` attribute now works like v3. This change is intended to separate direct interaction from potential.
* Key logging and the corresponding `whatInput.keys()` API option have been removed.
* Event binding and attributes are now added to the `` tag to eliminate the need to test for `DOMContentLoaded`.
* The `whatInput.set()` API option has been removed.
* A new set of `whatinput-types-[type]` classes are now added as inputs are detected. New classes are added but existing ones remain, creating the same output as what the `whatInput.types()` returns.
## How it works
What Input uses event bubbling on the `` tag to watch for mouse, keyboard and touch events (via `mousedown`, `keydown` and `touchstart`). It then sets or updates a `data-whatinput` attribute.
Where present, 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 or set the current input.
_What Input does not make assumptions about the input environment before the page is directly 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_.
### Interacting with Forms
Since interacting with a form requires use of the keyboard, What Input _does not switch the input type while form ``s and `