keyboardevent-key-polyfill

WebJar for keyboardevent-key-polyfill

Лицензия

Лицензия

Категории

Категории

KeY Данные Data Formats Formal Verification
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

keyboardevent-key-polyfill
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

keyboardevent-key-polyfill
WebJar for keyboardevent-key-polyfill
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/cvan/keyboardevent-key-polyfill

Скачать keyboardevent-key-polyfill

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/keyboardevent-key-polyfill/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>keyboardevent-key-polyfill</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/keyboardevent-key-polyfill/
implementation 'org.webjars.npm:keyboardevent-key-polyfill:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/keyboardevent-key-polyfill/
implementation ("org.webjars.npm:keyboardevent-key-polyfill:1.1.0")
'org.webjars.npm:keyboardevent-key-polyfill:jar:1.1.0'
<dependency org="org.webjars.npm" name="keyboardevent-key-polyfill" rev="1.1.0">
  <artifact name="keyboardevent-key-polyfill" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='keyboardevent-key-polyfill', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "keyboardevent-key-polyfill" % "1.1.0"
[org.webjars.npm/keyboardevent-key-polyfill "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

keyboardevent-key-polyfill

Polyfill for KeyboardEvent.prototype.key.

NOTE: All major browsers now support KeyboardEvent.prototype.key. Firefox already shipped with this for a while; recent versions of Edge, Chrome, and Safari also now have shipped support. This will still enable KeyboardEvent.prototype.key in environments where it may not yet be available.

Example

View Demo


Say goodbye to this:

document.addEventListener('keydown', function (e) {
  console.log('Code of key pressed:', e.which || e.keyCode);  // 39
});

And hello to this:

document.addEventListener('keydown', function (e) {
  console.log('Name of key pressed:', e.key);  // ArrowRight
});

Usage

From standalone script

Just drop the script on your page and call the polyfill method.

<script src="index.js"></script>
<script>keyboardeventKeyPolyfill.polyfill();</script>

If you're using AMD:

require('keyboardevent-key-polyfill').polyfill();

From npm (Node/Browserify/WebPack)

Install from npm:

npm install keyboardevent-key-polyfill

Then require the CommonJS module for use with Browserify/webpack:

require('keyboardevent-key-polyfill').polyfill();

License

All code and content within this source-code repository is licensed under the Creative Commons Zero v1.0 Universal license (CC0 1.0 Universal; Public Domain Dedication).

You can copy, modify, distribute and perform this work, even for commercial purposes, all without asking permission.

For more information, refer to these following links:

Версии библиотеки

Версия
1.1.0