{"name":"what-input","version":"5.0.1","keywords":["accessibility","a11y","input","javascript"],"author":{"name":"Jeremy Fields","email":"jeremy.fields@viget.com"},"license":"MIT","_id":"what-input@5.0.1","maintainers":[{"name":"ten1seven","email":"jeremy@ten1seven.com"}],"homepage":"https://github.com/ten1seven/what-input","bugs":{"url":"https://github.com/ten1seven/what-input/issues"},"dist":{"shasum":"1513641f91414b6f839259d04943afb2c0439c4a","tarball":"http://registry-npm.ywwl.com/what-input/download/what-input-5.0.1.tgz","integrity":"sha512-vVIfKBbZbT7PkfS8KCrg8AVnaj31DGxkS4FpnyLofKjiYqtMTYA4oQE7SnJt16FXJZK8f3r9iv4m1WMTI8c9GQ==","signatures":[{"sig":"MEYCIQCOwfNkrbKFCNKTS/r8WEK6YjXMIwpRElPkDcO7a5gvBwIhAIWRpA7RBZ32+YNoe171lr5Nq4sVOEsvWqczXzznzrM9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":72177,"noattachment":false,"key":"/what-input/-/what-input-5.0.1.tgz"},"main":"dist/what-input.js","gitHead":"2550600177591c617310c0ce529bd0b0f5d6d7f5","scripts":{"start":"gulp"},"_npmUser":{"name":"ten1seven","email":"jeremy@ten1seven.com"},"repository":{"url":"git+https://github.com/ten1seven/what-input.git","type":"git"},"_npmVersion":"5.0.4","description":"A global utility for tracking the current input method (mouse, keyboard or touch).","directories":{},"_nodeVersion":"5.9.0","devDependencies":{"del":"2.2.0","gulp":"3.9.1","gulp-sass":"^3.1.0","babel-core":"^6.23.1","gulp-concat":"2.6.0","gulp-header":"1.7.1","gulp-notify":"2.2.0","gulp-rename":"1.2.2","gulp-uglify":"^2.0.0","autoprefixer":"^6.7.7","babel-loader":"^6.3.2","browser-sync":"2.11.1","css-mqpacker":"^5.0.1","gulp-cssnano":"^2.1.2","gulp-plumber":"1.1.0","gulp-postcss":"^6.4.0","run-sequence":"1.1.5","gulp-gh-pages":"^0.5.4","gulp-standard":"^8.0.4","gulp-sass-glob":"^1.0.8","webpack-stream":"3.2.0","gulp-sourcemaps":"^2.6.0","babel-preset-es2015":"^6.22.0"},"_npmOperationalInternal":{"tmp":"tmp/what-input-5.0.1.tgz_1504618715602_0.4534407660830766","host":"s3://npm-registry-packages"},"readme":"# What Input?\n\n**A global utility for tracking the current input method (mouse, keyboard or touch).**\n\n## _What Input_ is now v6\n\nRebuilt for the modern web: Pointer Events, `KeyboardEvent.key`, TypeScript, native ES modules, and an `EventTarget` API. The outputs are the same as v5, so it's a drop-in upgrade for existing sites. See the [changelog](#changelog) for the few things that changed.\n\n_What Input_ adds data attributes to the `<html>` element based on the type of input being used. It also exposes a simple API that can be used for scripting interactions.\n\n## How it works\n\n_What Input_ listens on the `window` (in the capture phase, so local `stopPropagation()` calls don't hide anything) for:\n\n- `pointerdown` – a direct interaction. `pointerType` decides whether it's `mouse` or `touch` (`pen` is reported as `touch`).\n- `keydown` / `keyup` – a direct `keyboard` interaction, unless the key is on the ignore list (modifiers by default).\n- `pointermove` / `wheel` – an _indirect_ signal that a mouse is present.\n- `focusin` / `focusout` – which element currently has focus.\n\nIt then sets or updates these attributes on `<html>`:\n\n| Attribute          | Values                                      | Updated by                                             |\n| ------------------ | ------------------------------------------- | ------------------------------------------------------ |\n| `data-whatinput`   | `initial`, `mouse`, `keyboard`, `touch`     | `pointerdown`, `keydown`, `keyup`                      |\n| `data-whatintent`  | `initial`, `mouse`, `keyboard`, `touch`     | everything above plus `pointermove` and `wheel`        |\n| `data-whatelement` | the focused element's tag name, e.g. `a`    | `focusin` / `focusout`                                 |\n| `data-whatclasses` | the focused element's classes, e.g. `a,b,c` | `focusin` / `focusout` (only when the element has any) |\n\n_What Input does not make assumptions about the input environment before the page is interacted with._ However, the `pointermove` and `wheel` events are used to set `data-whatintent=\"mouse\"` to indicate that a mouse is being used _indirectly_.\n\n### Interacting with forms\n\nSince 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 `<input>`s, `<select>`s, `<textarea>`s, `contenteditable` elements, [form-associated custom elements](https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals) and `<button>`s inside a `<form>` are being interacted with (i.e. a mouse user's `data-whatintent` will be preserved as `mouse` while typing). `data-whatinput` always reflects the actual last input.\n\nCheckboxes and radio buttons are toggled rather than typed into, so pressing a key on one _does_ switch the intent to `keyboard`.\n\nThe same buffering can be opted into for any other element by adding a `data-whatfreeze` attribute to it or to a container. This is handy for custom controls that are operated with the arrow keys, like a slider or a video scrubber, where pressing a key is not a change of intent:\n\n```html\n<div class=\"scrubber\" data-whatfreeze>\n  <div class=\"scrubber-handle\" role=\"slider\" tabindex=\"0\" ...></div>\n</div>\n```\n\n### Device hint\n\nBefore anyone interacts with the page, `data-whatinput` and `data-whatintent` are `initial` on purpose. When a best guess is still useful (sizing hit targets on first paint, say), the `data-whathint` attribute carries what the device's _primary_ pointer suggests, read from the [`pointer` interaction media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer):\n\n| `data-whathint` | Media query         | Typically                    |\n| --------------- | ------------------- | ---------------------------- |\n| `touch`         | `(pointer: coarse)` | phones, tablets              |\n| `mouse`         | `(pointer: fine)`   | desktops, laptops, trackpads |\n| `unknown`       | neither             | keyboard-only devices, TVs   |\n\nThe hint follows the device live (a mouse paired with a tablet, a keyboard detached from one) and is never persisted. It is only a hint: an iPad with a trackpad still reports `touch`, and a touch-screen laptop reports `mouse`. `data-whatinput` and `data-whatintent` never use it.\n\n### Isn't this what `:focus-visible` is for?\n\nPartly. [`:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible) is a great default for focus rings and you should use it. _What Input_ is still useful when you want to:\n\n- style anything other than focus (hover affordances, hit targets, tooltips) based on how the page is being used;\n- know the input method from JavaScript;\n- tell `mouse` and `touch` apart;\n- remember the input method across page loads so the first render is already right.\n\n## Demo\n\nCheck out the demo to see _What Input_ in action.\n\nhttps://ten1seven.github.io/what-input\n\n## Installing\n\nInstall via npm (or your package manager of choice):\n\n```shell\nnpm install what-input\n```\n\nOr load it from a CDN:\n\n```html\n<script src=\"https://unpkg.com/what-input@6\"></script>\n```\n\nOr download `dist/what-input.js` and include it directly.\n\n## Usage\n\nInclude the script directly in your project. It exposes a global `whatInput`.\n\n```html\n<script src=\"path/to/what-input.js\"></script>\n```\n\nOr import it. The package ships as an ES module (`dist/what-input.mjs`), as a UMD build (`dist/what-input.js`, which also covers CommonJS and AMD) and with TypeScript declarations.\n\n```javascript\nimport 'what-input'\n\n// or\n\nimport whatInput from 'what-input'\n\n// or\n\nconst whatInput = require('what-input')\n```\n\n_What Input_ will start doing its thing while you do yours.\n\n> **Bundlers:** importing the module has the side effect of starting _What Input_. The package declares `\"sideEffects\": true` so a bare `import 'what-input'` is never tree-shaken away.\n\n### Default behavior\n\n#### Persisting input/intent across pages\n\nBy default, _What Input_ uses [session storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) to persist the input and intent values across pages. The benefit is that once a visitor has interacted with the page, subsequent pages won't have to wait for interactions to know the input method.\n\nThis behavior can be disabled by adding a `data-whatpersist=\"false\"` attribute on either the `<html>` or `<body>`.\n\n```html\n<html dir=\"ltr\" lang=\"en\" data-whatpersist=\"false\">\n  ...\n</html>\n```\n\nor\n\n```html\n<body data-whatpersist=\"false\">\n  ...\n</body>\n```\n\nSession storage can be cleared at any time with:\n\n```javascript\nwhatInput.clearStorage()\n```\n\n### Basic styling\n\n```css\n/*\n * only suppress the focus ring once what-input has successfully started\n */\n\n/* suppress focus ring on form controls for mouse users */\n[data-whatintent='mouse'] *:focus {\n  outline: none;\n}\n```\n\nA more modern take pairs _What Input_ with `:focus-visible` and only reaches for the data attributes where the browser heuristic isn't enough:\n\n```css\n:focus-visible {\n  outline: 2px solid currentColor;\n  outline-offset: 2px;\n}\n\n/* bigger hit areas while a touch screen is being used */\n[data-whatintent='touch'] .toolbar button {\n  min-block-size: 44px;\n}\n```\n\n**Note:** If you remove outlines with `outline: none;`, be sure to provide clear visual `:focus` styles so the user can see which element they are on at any time for greater accessibility. Visit [W3C's WCAG 2.2 2.4.7 Guideline](https://www.w3.org/WAI/WCAG22/Understanding/focus-visible.html) to learn more.\n\n### Scripting\n\n#### Current input\n\nAsk _What Input_ what the current input method is. This works best if asked after the events _What Input_ is bound to (`pointerdown` and `keydown`).\n\n```javascript\nwhatInput.ask() // returns `mouse`, `keyboard` or `touch`\n\nmyButton.addEventListener('click', () => {\n  if (whatInput.ask() === 'mouse') {\n    // do mousy things\n  } else if (whatInput.ask() === 'keyboard') {\n    // do keyboard things\n  }\n})\n```\n\nIf it's necessary to know if `pointermove` is being used, use the `'intent'` option. For example:\n\n```javascript\n/*\n * nothing has happened but the mouse has moved\n */\n\nwhatInput.ask() // returns `initial` because the page has not been directly interacted with\nwhatInput.ask('intent') // returns `mouse` because mouse movement was detected\n\n/*\n * the keyboard has been used, then the mouse was moved\n */\n\nwhatInput.ask() // returns `keyboard` because the keyboard was the last direct page interaction\nwhatInput.ask('intent') // returns `mouse` because mouse movement was the most recent action detected\n```\n\nSince `click` events are `PointerEvent`s in current browsers, a single click handler can also read `event.pointerType` directly: it's `mouse`, `pen` or `touch`, and empty when the click came from the keyboard.\n\n#### Device hint\n\n```javascript\nwhatInput.ask('hint') // returns `mouse`, `touch` or `unknown`\n```\n\n#### Current element\n\nAsk _What Input_ the currently focused DOM element.\n\n```javascript\nwhatInput.element() // returns a string, like `input`, or null\n```\n\n#### Ignore keys\n\nSet a custom list of keys that will be ignored (will not switch over to `keyboard`) when pressed. Keys can be [`KeyboardEvent.key`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values) values, [`KeyboardEvent.code`](https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values) values or legacy [keycodes](https://www.toptal.com/developers/keycode). _A custom list will overwrite the default values._\n\n```javascript\n/*\n * default ignored keys:\n * 'Shift'\n * 'Control'\n * 'Alt'\n * 'Meta'        // Windows key / Apple cmd\n * 'ContextMenu' // Windows menu key\n */\n\nwhatInput.ignoreKeys(['Shift', 'CapsLock', 'F11'])\n\n// legacy keycodes still work\nwhatInput.ignoreKeys([16, 20, 122])\n```\n\n#### Specific keys\n\nSet a custom list of keys that will trigger the keyboard pressed intent (will not switch to `keyboard` unless these keys are pressed). _This overrides ignoreKeys._\n\n```javascript\n// only listen to tab keyboard press\nwhatInput.specificKeys(['Tab'])\n\n// go back to using the ignore list\nwhatInput.specificKeys([])\n```\n\n#### Custom callbacks\n\nFire a function when the input or intent changes.\n\n```javascript\n// create a function to be fired\nconst myFunction = (type) => {\n  console.log(type)\n}\n\n// fire `myFunction` when the intent changes\nwhatInput.registerOnChange(myFunction, 'intent')\n\n// fire `myFunction` when the input changes\nwhatInput.registerOnChange(myFunction, 'input')\n\n// fire `myFunction` when the device hint changes\nwhatInput.registerOnChange(myFunction, 'hint')\n\n// remove custom event\nwhatInput.unRegisterOnChange(myFunction)\n```\n\n#### Events\n\n`whatInput` is an [`EventTarget`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget). It dispatches `input`, `intent` and `hint` [`CustomEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent)s whose `detail` is the new value, so all the usual listener options (`once`, `signal`, ...) are available.\n\n```javascript\nwhatInput.addEventListener('intent', (event) => {\n  console.log(event.detail) // `mouse`, `keyboard` or `touch`\n})\n\n// listen until a component unmounts\nconst controller = new AbortController()\n\nwhatInput.addEventListener('input', update, { signal: controller.signal })\n\ncontroller.abort()\n```\n\nIn browsers that ship the [Observable API](https://developer.mozilla.org/en-US/docs/Web/API/Observable), `whatInput.when('intent')` works too, for free.\n\n#### Tearing down\n\nStop listening, remove the `data-what*` attributes and drop every callback. Mostly useful in tests and when an app is unmounted.\n\n```javascript\nwhatInput.destroy()\n```\n\n### TypeScript\n\nTypes ship with the package.\n\n```typescript\nimport whatInput, { type InputMethod, type Strategy } from 'what-input'\n\nconst current: InputMethod = whatInput.ask('intent')\n```\n\n### Server-side rendering\n\n_What Input_ can be imported in Node, workers and other environments without a DOM. It won't observe anything, `ask()` always answers `initial` and `element()` always answers `null`.\n\n### Shadow DOM\n\n_What Input_ reports focus inside open shadow roots and knows when a keypress lands in a field inside one. The attributes still live on `<html>`, and selectors in the main document don't reach into a shadow tree, so style from inside the component instead. `:host-context()` works in Chromium and Safari; for every browser, mirror the state onto the host with the events:\n\n```javascript\nclass MyField extends HTMLElement {\n  connectedCallback() {\n    this.controller = new AbortController()\n\n    whatInput.addEventListener(\n      'intent',\n      (event) => this.setAttribute('data-whatintent', event.detail),\n      { signal: this.controller.signal },\n    )\n  }\n\n  disconnectedCallback() {\n    this.controller.abort()\n  }\n}\n```\n\n```css\n/* inside the shadow root */\n:host([data-whatintent='mouse']) :focus {\n  outline: none;\n}\n```\n\n### Testing\n\nThe state only changes in response to real events, which is also the easiest way to drive it in tests. In a DOM test environment that implements `PointerEvent` (jsdom 22+, happy-dom, every browser):\n\n```javascript\nwindow.dispatchEvent(new PointerEvent('pointerdown', { pointerType: 'touch' }))\nwhatInput.ask() // `touch`\n\nwindow.dispatchEvent(new KeyboardEvent('keydown', { key: 'Tab' }))\nwhatInput.ask() // `keyboard`\n```\n\nOr mock the module entirely:\n\n```javascript\nvi.mock('what-input', () => ({ default: { ask: () => 'touch' } }))\n```\n\n## Compatibility\n\n_What Input_ v6 works in all evergreen browsers: Chrome and Edge 90+, Firefox 90+ and Safari 15+ (2021 and newer). It relies on Pointer Events, `AbortSignal` support in `addEventListener()`, `EventTarget` subclassing and class private fields, none of which are polyfilled.\n\nThe UMD builds (`dist/what-input.js` and `dist/what-input.min.js`) are emitted as ES2019 syntax so that older bundlers such as webpack 4 can still parse them. The ES module build (`dist/what-input.mjs`) targets ES2022. The browser requirements are the same for both.\n\nIf you need to support older browsers, stay on [v5](https://github.com/ten1seven/what-input/tree/v5.2.12).\n\n## Contributing\n\n```shell\nnpm install   # install dependencies\nnpm run dev   # run the demo with hot reloading\nnpm test      # build the library and run the tests\nnpm run lint  # prettier and type checks\nnpm run build # build the library and the demo site\n```\n\n## Changelog\n\n### v6.0.1\n\n- **Fixed:** The UMD builds are emitted as ES2019 syntax (no class fields, private fields, optional chaining or nullish coalescing) so that older bundlers such as webpack 4 can parse them. Foundation's open-ended `what-input` peer range means v6 reaches a lot of older build pipelines on fresh installs. The ES module build still targets ES2022 and browser support is unchanged.\n\n### v6.0.0\n\nA rewrite in TypeScript on modern browser APIs. The data attributes, the session storage keys, the API and the `dist/what-input.js` file path are unchanged, so for most sites this is a drop-in upgrade.\n\n- **Breaking:** Drops support for Internet Explorer and other legacy browsers. The build targets ES2022 and is no longer transpiled.\n- **Breaking:** Detection is built on Pointer Events only. The `mousedown`, `mousemove`, `touchstart`, `touchend`, `MSPointerDown`, `MSPointerMove`, `mousewheel` and `DOMMouseScroll` listeners (and the 200ms touch-versus-mouse buffer they required) are gone.\n- **Breaking:** `clearStorage()` now removes only _What Input_'s own `what-input` and `what-intent` keys instead of wiping the entire session storage.\n- **Breaking:** `pointerdown` now updates the intent as well as the input, even while a form field has focus. Only keyboard use inside form fields is buffered.\n- **Breaking:** `unRegisterOnChange(fn)` removes `fn` from both the `input` and `intent` lists.\n- **Breaking:** The `InputMethod` type no longer includes `pointer`, which was never actually reported.\n- **Breaking:** Requires Node 20+ for development. The build uses esbuild, the demo uses Vite and the tests use Vitest; Gulp, Webpack, Babel, Sass and Yarn are gone.\n- **Added:** A `data-whathint` attribute, `ask('hint')` and a `hint` event report what the device's primary pointer suggests (`mouse`, `touch` or `unknown`) from the `pointer` interaction media feature, before any interaction and live as devices are attached or removed. The existing attributes never use it.\n- **Added:** A `data-whatfreeze` attribute opts any element (or container) into the same intent buffering that form fields get, for custom controls driven by the arrow keys ([#123](https://github.com/ten1seven/what-input/issues/123)).\n- **Added:** An ES module build (`dist/what-input.mjs`) with a proper `exports` map, `module` and `unpkg` fields. The UMD build (`dist/what-input.js`) and the minified build remain for `<script>` tags, CommonJS and AMD.\n- **Added:** `whatInput` is an `EventTarget` and dispatches `input` and `intent` events.\n- **Added:** `whatInput.destroy()` tears everything down (listeners are bound with an `AbortController`).\n- **Added:** `ignoreKeys()` and `specificKeys()` accept `KeyboardEvent.key` and `KeyboardEvent.code` strings alongside legacy keycodes. The defaults are now key names.\n- **Added:** Typing inside `contenteditable` elements and form-associated custom elements no longer changes the intent, just like form fields.\n- **Fixed:** Pressing a key on a checkbox or radio button switches the intent to `keyboard`; they are toggled, not typed into ([#128](https://github.com/ten1seven/what-input/issues/128)).\n- **Fixed:** Long-presses in Firefox for Android no longer flash `data-whatintent=\"mouse\"`, because the emulated mouse events are no longer listened to ([#94](https://github.com/ten1seven/what-input/issues/94)).\n- **Added:** Focus inside open shadow roots is reported for the inner element (via `composedPath()`), and the active-element check follows shadow roots when deciding whether a keypress is text entry.\n- **Added:** Persisted session storage values are validated before they are used.\n- **Changed:** Type declarations are generated from the source and shipped in `dist/`.\n- **Changed:** `pointerdown` and `keydown` are observed in the capture phase on `window`, so `whatInput.ask()` is already up to date inside any element's own event handler, even one that calls `preventDefault()` or `stopPropagation()` ([#80](https://github.com/ten1seven/what-input/issues/80)).\n- **Changed:** When the script runs after `DOMContentLoaded` (dynamic `import()`, late-loaded scripts) the initial state is published immediately instead of never.\n- **Changed:** An interaction that happens before `DOMContentLoaded` is no longer overwritten by the persisted value.\n- **Fixed:** `data-whatclasses` separates _all_ classes with commas (`a,b,c`); previously only the first space was replaced.\n- **Fixed:** `data-whatclasses` is removed when focus moves to an element without classes.\n\n### v5.2.12\n\n- **Fixed:** Improved detection and respect for of `data-whatpersist` before `DOMContentLoaded`. Fix via [FanFataL](https://github.com/FanFataL).\n\n### v5.2.11\n\n- **Fixed:** Adds `useCapture` so events can be detected before `preventDefault` cancels them on local listeners (h/t [jojo080889](https://github.com/jojo080889)).\n\n### v5.2.8 - 5.2.10\n\n- **Added:** TypeScript definitions via [greypants](https://github.com/greypants).\n\n### v5.2.7\n\n- **Fixed:** Moves sourcemap to sit next to JavaScript package.\n\n### v5.2.6\n\n- **Fixed:** adds `DOMContentLoaded` event before looking for `data-whatpersist` attribute on body.\n\n### v5.2.5\n\n- **Fixed:** Hotfix for shaky support of `dataset` in IE10.\n\n### v5.2.4\n\n- **Added:** Ability to add `data-whatpersist=\"false\"` attribute to the `<html>` or `<body>` tag to disable usage of session storage to persist input/intent across pages.\n- **Updated:** Build tools and added linting.\n\n### v5.2.3\n\n- **Fixed:** `activeElement` is null bug in IE is fixed (thanks @EasterPeanut).\n- **Fixed:** Mousewheel event detection works correctly again.\n\n### v5.2.1\n\n- **Fixed:** iOS was occasionally reporting `mouse` because of event execution order.\n- **Added:** `touchend` to input map\n- **Added:** Allows buttons inside forms to be treated like other form inputs.\n- **Added:** iTouch intent indicator in demo page (it worked all along, you just couldn't see it).\n\n### v5.1.4\n\n- **Fixed:** Increase buffering time by 20ms to fix iOS reporting mousedown\n- **Fixed:** Adds `touchend` to input map\n\n### v5.1.3\n\n- **Added:** Sourcemap for the minified version.\n\n### v5.1.2\n\n- **Added:** `specificKeys` functionality to allow overriding of keyboard keys list. Fix via [bk3](https://github.com/bk3).\n\n### v5.1.1\n\n- **Fixed:** Browsers with cookies turned off would throw an error with session storage. Fix via [yuheiy](https://github.com/yuheiy).\n\n### v5.1.0\n\n- **Added:** Session variable stores last used input and intent so subsequent page loads don't have to wait for interactions to set the correct input and intent state.\n- **Removed:** IE8 support.\n\n### v5.0.7\n\n- **Fixed:** `unRegisterOnChange` failed to unregister items at index 0.\n\n### v5.0.5\n\n- **Fixed:** Fail gracefully in non-DOM environments.\n\n### v5.0.3\n\n- **Fixed:** Event buffer for touch was not working correctly.\n\n### Changes from v4\n\n- **Added:** A the ability to add and remove custom callback function when the input or intent changes with `whatInput.registerOnChange` and `whatInput.unRegisterOnChange`.\n- **Added:** A `data-whatelement` attribute exposes any currently focused DOM element (i.e. `data-whatelement=\"a\"` or `data-whatelement=\"input\"`).\n- **Added:** A `data-whatclasses` attribute exposes any currently focused element's classes as a comma-separated list (i.e. `data-whatclasses=\"class1,class2\"`).\n- **Added:** An API option to provide a custom array of keycodes that will be ignored.\n- **Changed:** Typing in form fields is no longer filtered out. The `data-whatinput` attribute immediately reflects the current input. The `data-whatintent` attribute now takes on the role of remembering mouse input prior to typing in or clicking on a form field.\n- **Changed:** If you use the Tab key to move from one input to another one - the `data-whatinput` attribute reflects the current input (switches to \"keyboard\").\n- **Removed:** `whatInput.types()` API option.\n- **Removed:** Bower support.\n- **Fixed:** Using mouse modifier keys (`shift`, `control`, `alt`, `cmd`) no longer toggles back to keyboard.\n\n## Acknowledgments\n\nSpecial thanks to [Viget](https://viget.com/) for their encouragement and commitment to open source projects. Visit [code.viget.com](https://code.viget.com/) to see more projects from [Viget](https://viget.com).\n\nThanks to [mAAdhaTTah](https://github.com/mAAdhaTTah) for the initial conversion to Webpack. Thanks to [greypants](https://github.com/greypants) for adding TypeScript definitions.\n\n_What Input_ is written and maintained by [@ten1seven](https://github.com/ten1seven).\n\n## License\n\n_What Input_ is freely available under the [MIT License](http://opensource.org/licenses/MIT).\n","publish_time":1504618715741,"_cnpm_publish_time":1504618715741,"dist-tags":{"latest":"6.0.2"}}